dialog box to provide status of transition report preparation
This commit is contained in:
parent
a3ca919a57
commit
9fd18c177d
177
PROMS/VEPROMS User Interface/dlgTransitionReport.Designer.cs
generated
Normal file
177
PROMS/VEPROMS User Interface/dlgTransitionReport.Designer.cs
generated
Normal file
@ -0,0 +1,177 @@
|
||||
namespace VEPROMS
|
||||
{
|
||||
partial class dlgTransitionReport
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.lblProcs = new System.Windows.Forms.Label();
|
||||
this.pbProcs = new System.Windows.Forms.ProgressBar();
|
||||
this.pnlProcs = new System.Windows.Forms.Panel();
|
||||
this.pnlTrans = new System.Windows.Forms.Panel();
|
||||
this.lblTrans = new System.Windows.Forms.Label();
|
||||
this.pbTrans = new System.Windows.Forms.ProgressBar();
|
||||
this.tmrReportStart = new System.Windows.Forms.Timer(this.components);
|
||||
this.tmrReportFinish = new System.Windows.Forms.Timer(this.components);
|
||||
this.pnlVersions = new System.Windows.Forms.Panel();
|
||||
this.lblVersions = new System.Windows.Forms.Label();
|
||||
this.pbVersions = new System.Windows.Forms.ProgressBar();
|
||||
this.pnlProcs.SuspendLayout();
|
||||
this.pnlTrans.SuspendLayout();
|
||||
this.pnlVersions.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblProcs
|
||||
//
|
||||
this.lblProcs.AutoSize = true;
|
||||
this.lblProcs.Location = new System.Drawing.Point(12, 17);
|
||||
this.lblProcs.Name = "lblProcs";
|
||||
this.lblProcs.Size = new System.Drawing.Size(117, 13);
|
||||
this.lblProcs.TabIndex = 0;
|
||||
this.lblProcs.Text = "Procedures Processed:";
|
||||
//
|
||||
// pbProcs
|
||||
//
|
||||
this.pbProcs.Location = new System.Drawing.Point(12, 43);
|
||||
this.pbProcs.Name = "pbProcs";
|
||||
this.pbProcs.Size = new System.Drawing.Size(369, 23);
|
||||
this.pbProcs.Step = 1;
|
||||
this.pbProcs.TabIndex = 1;
|
||||
//
|
||||
// pnlProcs
|
||||
//
|
||||
this.pnlProcs.Controls.Add(this.lblProcs);
|
||||
this.pnlProcs.Controls.Add(this.pbProcs);
|
||||
this.pnlProcs.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.pnlProcs.Location = new System.Drawing.Point(0, 86);
|
||||
this.pnlProcs.Name = "pnlProcs";
|
||||
this.pnlProcs.Size = new System.Drawing.Size(394, 86);
|
||||
this.pnlProcs.TabIndex = 2;
|
||||
//
|
||||
// pnlTrans
|
||||
//
|
||||
this.pnlTrans.Controls.Add(this.lblTrans);
|
||||
this.pnlTrans.Controls.Add(this.pbTrans);
|
||||
this.pnlTrans.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pnlTrans.Location = new System.Drawing.Point(0, 172);
|
||||
this.pnlTrans.Name = "pnlTrans";
|
||||
this.pnlTrans.Size = new System.Drawing.Size(394, 86);
|
||||
this.pnlTrans.TabIndex = 3;
|
||||
//
|
||||
// lblTrans
|
||||
//
|
||||
this.lblTrans.AutoSize = true;
|
||||
this.lblTrans.Location = new System.Drawing.Point(12, 17);
|
||||
this.lblTrans.Name = "lblTrans";
|
||||
this.lblTrans.Size = new System.Drawing.Size(114, 13);
|
||||
this.lblTrans.TabIndex = 0;
|
||||
this.lblTrans.Text = "Transitions Processed:";
|
||||
//
|
||||
// pbTrans
|
||||
//
|
||||
this.pbTrans.Location = new System.Drawing.Point(12, 43);
|
||||
this.pbTrans.Name = "pbTrans";
|
||||
this.pbTrans.Size = new System.Drawing.Size(369, 23);
|
||||
this.pbTrans.Step = 1;
|
||||
this.pbTrans.TabIndex = 1;
|
||||
//
|
||||
// tmrReportStart
|
||||
//
|
||||
this.tmrReportStart.Tick += new System.EventHandler(this.tmrReportStart_Tick);
|
||||
//
|
||||
// tmrReportFinish
|
||||
//
|
||||
this.tmrReportFinish.Tick += new System.EventHandler(this.tmrReportFinish_Tick);
|
||||
//
|
||||
// pnlVersions
|
||||
//
|
||||
this.pnlVersions.Controls.Add(this.lblVersions);
|
||||
this.pnlVersions.Controls.Add(this.pbVersions);
|
||||
this.pnlVersions.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.pnlVersions.Location = new System.Drawing.Point(0, 0);
|
||||
this.pnlVersions.Name = "pnlVersions";
|
||||
this.pnlVersions.Size = new System.Drawing.Size(394, 86);
|
||||
this.pnlVersions.TabIndex = 4;
|
||||
//
|
||||
// lblVersions
|
||||
//
|
||||
this.lblVersions.AutoSize = true;
|
||||
this.lblVersions.Location = new System.Drawing.Point(12, 17);
|
||||
this.lblVersions.Name = "lblVersions";
|
||||
this.lblVersions.Size = new System.Drawing.Size(136, 13);
|
||||
this.lblVersions.TabIndex = 0;
|
||||
this.lblVersions.Text = "Procedure Sets Processed:";
|
||||
//
|
||||
// pbVersions
|
||||
//
|
||||
this.pbVersions.Location = new System.Drawing.Point(12, 43);
|
||||
this.pbVersions.Name = "pbVersions";
|
||||
this.pbVersions.Size = new System.Drawing.Size(369, 23);
|
||||
this.pbVersions.Step = 1;
|
||||
this.pbVersions.TabIndex = 1;
|
||||
//
|
||||
// dlgTransitionReport
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(394, 258);
|
||||
this.Controls.Add(this.pnlTrans);
|
||||
this.Controls.Add(this.pnlProcs);
|
||||
this.Controls.Add(this.pnlVersions);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "dlgTransitionReport";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Transition Report Progress Dialog";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.dlgTransitionReport_Load);
|
||||
this.pnlProcs.ResumeLayout(false);
|
||||
this.pnlProcs.PerformLayout();
|
||||
this.pnlTrans.ResumeLayout(false);
|
||||
this.pnlTrans.PerformLayout();
|
||||
this.pnlVersions.ResumeLayout(false);
|
||||
this.pnlVersions.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblProcs;
|
||||
private System.Windows.Forms.ProgressBar pbProcs;
|
||||
private System.Windows.Forms.Panel pnlProcs;
|
||||
private System.Windows.Forms.Panel pnlTrans;
|
||||
private System.Windows.Forms.Label lblTrans;
|
||||
private System.Windows.Forms.ProgressBar pbTrans;
|
||||
private System.Windows.Forms.Timer tmrReportStart;
|
||||
private System.Windows.Forms.Timer tmrReportFinish;
|
||||
private System.Windows.Forms.Panel pnlVersions;
|
||||
private System.Windows.Forms.Label lblVersions;
|
||||
private System.Windows.Forms.ProgressBar pbVersions;
|
||||
}
|
||||
}
|
137
PROMS/VEPROMS User Interface/dlgTransitionReport.cs
Normal file
137
PROMS/VEPROMS User Interface/dlgTransitionReport.cs
Normal file
@ -0,0 +1,137 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Print.Library;
|
||||
using Volian.Base.Library;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
public partial class dlgTransitionReport : Form
|
||||
{
|
||||
private FolderInfo folderInfo = null;
|
||||
private ProcedureInfo procedureInfo = null;
|
||||
private PDFTransitionReport rpt;
|
||||
private List<DocVersionInfo> lstDocVersions;
|
||||
public dlgTransitionReport(FolderInfo fi)
|
||||
{
|
||||
InitializeComponent();
|
||||
folderInfo = fi;
|
||||
lstDocVersions = new List<DocVersionInfo>();
|
||||
LoadDocVersionList(folderInfo);
|
||||
if (lstDocVersions.Count == 1)
|
||||
{
|
||||
pnlVersions.Visible = false;
|
||||
this.Height = this.Height - pnlVersions.Height;
|
||||
}
|
||||
}
|
||||
public dlgTransitionReport(ProcedureInfo pi)
|
||||
{
|
||||
InitializeComponent();
|
||||
procedureInfo = pi;
|
||||
pnlVersions.Visible = pnlProcs.Visible = false;
|
||||
this.Height = this.Height - pnlVersions.Height - pnlProcs.Height;
|
||||
}
|
||||
//private DocVersionInfo docVersionInfo;
|
||||
private void dlgTransitionReport_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (folderInfo != null)
|
||||
{
|
||||
rpt = new PDFTransitionReport(folderInfo, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf");
|
||||
rpt.MyDocVersionList = lstDocVersions;
|
||||
if (lstDocVersions.Count == 1)
|
||||
pbProcs.Maximum = lstDocVersions[0].Procedures.Count;
|
||||
else
|
||||
pbVersions.Maximum = lstDocVersions.Count;
|
||||
tmrReportStart.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (VlnSettings.GetCommandFlag("PROFILE")) ProfileTimer.TurnOnTracking("Profile.txt");
|
||||
VEPROMS.CSLA.Library.Database.TrackDBUsage = VlnSettings.GetCommandFlag("DBTrack");
|
||||
ProfileTimer.Reset();
|
||||
int profileDepth = ProfileTimer.Push(">>>> transitionreport");
|
||||
rpt = new PDFTransitionReport(procedureInfo, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf");
|
||||
pbTrans.Maximum = rpt.TransitionInfoCount;
|
||||
tmrReportStart.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadDocVersionList(FolderInfo fi)
|
||||
{
|
||||
if(fi.FolderDocVersionCount == 1)
|
||||
lstDocVersions.Add(fi.FolderDocVersions[0]);
|
||||
else
|
||||
foreach(FolderInfo fic in fi.ChildFolders)
|
||||
LoadDocVersionList(fic);
|
||||
}
|
||||
|
||||
void rpt_TransitionProcessed(object sender, EventArgs args)
|
||||
{
|
||||
pbTrans.PerformStep();
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
private void tmrReportStart_Tick(object sender, EventArgs e)
|
||||
{
|
||||
tmrReportStart.Enabled = false;
|
||||
if (folderInfo != null)
|
||||
{
|
||||
if (lstDocVersions.Count == 1)
|
||||
{
|
||||
rpt.ProcedureProcessed += new TransitionReportEvent(rpt_ProcedureProcessed);
|
||||
rpt.TransitionProcessed += new TransitionReportEvent(rpt_TransitionProcessed);
|
||||
rpt.BuildTransitionReport();
|
||||
rpt.ProcedureProcessed -= new TransitionReportEvent(rpt_ProcedureProcessed);
|
||||
rpt.TransitionProcessed -= new TransitionReportEvent(rpt_TransitionProcessed);
|
||||
tmrReportFinish.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
rpt.DocVersionProcessed += new TransitionReportEvent(rpt_DocVersionProcessed);
|
||||
rpt.ProcedureProcessed += new TransitionReportEvent(rpt_ProcedureProcessed);
|
||||
rpt.TransitionProcessed += new TransitionReportEvent(rpt_TransitionProcessed);
|
||||
rpt.BuildTransitionReport();
|
||||
rpt.ProcedureProcessed -= new TransitionReportEvent(rpt_ProcedureProcessed);
|
||||
rpt.TransitionProcessed -= new TransitionReportEvent(rpt_TransitionProcessed);
|
||||
rpt.DocVersionProcessed -= new TransitionReportEvent(rpt_DocVersionProcessed);
|
||||
tmrReportFinish.Enabled = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rpt.TransitionProcessed += new TransitionReportEvent(rpt_TransitionProcessed);
|
||||
rpt.BuildTransitionReport();
|
||||
pbTrans.Value = pbTrans.Maximum;
|
||||
rpt.TransitionProcessed -= new TransitionReportEvent(rpt_TransitionProcessed);
|
||||
tmrReportFinish.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
void rpt_DocVersionProcessed(object sender, EventArgs args)
|
||||
{
|
||||
pbProcs.Maximum = rpt.ProcedureCount;
|
||||
pbVersions.PerformStep();
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
void rpt_ProcedureProcessed(object sender, EventArgs args)
|
||||
{
|
||||
pbTrans.Value = 0;
|
||||
pbTrans.Maximum = rpt.TransitionInfoCount;
|
||||
pbProcs.PerformStep();
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
private void tmrReportFinish_Tick(object sender, EventArgs e)
|
||||
{
|
||||
tmrReportFinish.Enabled = false;
|
||||
System.Diagnostics.Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf");
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
126
PROMS/VEPROMS User Interface/dlgTransitionReport.resx
Normal file
126
PROMS/VEPROMS User Interface/dlgTransitionReport.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="tmrReportStart.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="tmrReportFinish.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>150, 17</value>
|
||||
</metadata>
|
||||
</root>
|
Loading…
x
Reference in New Issue
Block a user