diff --git a/PROMS/VEPROMS User Interface/dlgTransitionReport.Designer.cs b/PROMS/VEPROMS User Interface/dlgTransitionReport.Designer.cs new file mode 100644 index 00000000..90cb0e84 --- /dev/null +++ b/PROMS/VEPROMS User Interface/dlgTransitionReport.Designer.cs @@ -0,0 +1,177 @@ +namespace VEPROMS +{ + partial class dlgTransitionReport + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + 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; + } +} \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/dlgTransitionReport.cs b/PROMS/VEPROMS User Interface/dlgTransitionReport.cs new file mode 100644 index 00000000..a8cf15af --- /dev/null +++ b/PROMS/VEPROMS User Interface/dlgTransitionReport.cs @@ -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 lstDocVersions; + public dlgTransitionReport(FolderInfo fi) + { + InitializeComponent(); + folderInfo = fi; + lstDocVersions = new List(); + 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(); + } + } +} \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/dlgTransitionReport.resx b/PROMS/VEPROMS User Interface/dlgTransitionReport.resx new file mode 100644 index 00000000..28df958e --- /dev/null +++ b/PROMS/VEPROMS User Interface/dlgTransitionReport.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 150, 17 + + \ No newline at end of file