From 481589c0283689adaef2d300db473bd24c5d28f9 Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 11 Feb 2015 20:30:08 +0000 Subject: [PATCH] Added code to support converting to text transitions to external destinations with internal style transition Added wait cursor for log running processes so application shows it is busy Added stubs for adding Update RO Values to batch process. Not functional yet --- .../VEPROMS User Interface/dlgExportImport.cs | 17 +- .../frmBatchRefresh.Designer.cs | 26 +- .../VEPROMS User Interface/frmBatchRefresh.cs | 404 ++++++++++++------ 3 files changed, 305 insertions(+), 142 deletions(-) diff --git a/PROMS/VEPROMS User Interface/dlgExportImport.cs b/PROMS/VEPROMS User Interface/dlgExportImport.cs index 3c195901..9a84a952 100644 --- a/PROMS/VEPROMS User Interface/dlgExportImport.cs +++ b/PROMS/VEPROMS User Interface/dlgExportImport.cs @@ -2255,7 +2255,7 @@ namespace VEPROMS else replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); cc.Text = cc.Text.Replace(lookfor, replacewith); - bool forceConvertToText; + bool forceConvertToText = false; SectionConfig sc = TransitionInfo.Get(tt.TransitionID).MyItemToID.ActiveSection.MyConfig as SectionConfig; forceConvertToText = (sc.SubSection_Edit == "N"); cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); @@ -2284,9 +2284,22 @@ namespace VEPROMS else replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); cc.Text = cc.Text.Replace(lookfor, replacewith); - bool forceConvertToText; + bool forceConvertToText = false; SectionConfig sc = TransitionInfo.Get(tt.TransitionID).MyItemToID.ActiveSection.MyConfig as SectionConfig; forceConvertToText = (sc.SubSection_Edit == "N"); + if (!forceConvertToText) //check to see if external with internal format + { + TransitionInfo tran = TransitionInfo.Get(transitionid); + if (tran.MyContent.ContentItems[0].MyProcedure.ItemID != tran.MyItemToID.MyProcedure.ItemID) + if (!tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("Proc")) + forceConvertToText = true; + } + if (!forceConvertToText) //check to see if external to different doc version + { + TransitionInfo tran = TransitionInfo.Get(transitionid); + if (tran.MyContent.ContentItems[0].MyDocVersion.VersionID != tran.MyItemToID.MyDocVersion.VersionID) + forceConvertToText = true; + } cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); cc.Save(); nd.InnerText = "done"; diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs index 049a7e50..92290bdc 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs @@ -34,6 +34,7 @@ namespace VEPROMS this.label1 = new System.Windows.Forms.Label(); this.rbRefObj = new System.Windows.Forms.RadioButton(); this.rbTransition = new System.Windows.Forms.RadioButton(); + this.rbUpdate = new System.Windows.Forms.RadioButton(); this.myTV = new System.Windows.Forms.TreeView(); this.label2 = new System.Windows.Forms.Label(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); @@ -103,13 +104,14 @@ namespace VEPROMS this.splitContainer2.Panel1.Controls.Add(this.label1); this.splitContainer2.Panel1.Controls.Add(this.rbRefObj); this.splitContainer2.Panel1.Controls.Add(this.rbTransition); + this.splitContainer2.Panel1.Controls.Add(this.rbUpdate); // // splitContainer2.Panel2 // this.splitContainer2.Panel2.Controls.Add(this.myTV); this.splitContainer2.Panel2.Controls.Add(this.label2); this.splitContainer2.Size = new System.Drawing.Size(300, 472); - this.splitContainer2.SplitterDistance = 107; + this.splitContainer2.SplitterDistance = 120; this.splitContainer2.TabIndex = 0; // // rbBoth @@ -119,7 +121,7 @@ namespace VEPROMS this.rbBoth.Name = "rbBoth"; this.rbBoth.Size = new System.Drawing.Size(195, 17); this.rbBoth.TabIndex = 2; - this.rbBoth.Text = "Transitions and Referenced Objects"; + this.rbBoth.Text = "Refresh Transitions and Referenced Objects"; this.rbBoth.UseVisualStyleBackColor = true; this.rbBoth.Click += new System.EventHandler(this.Options_Changed); // @@ -142,23 +144,32 @@ namespace VEPROMS this.rbRefObj.Name = "rbRefObj"; this.rbRefObj.Size = new System.Drawing.Size(144, 17); this.rbRefObj.TabIndex = 1; - this.rbRefObj.Text = "Referenced Objects Only"; + this.rbRefObj.Text = "Refresh Referenced Objects Only"; this.rbRefObj.UseVisualStyleBackColor = true; this.rbRefObj.Click += new System.EventHandler(this.Options_Changed); // // rbTransition // this.rbTransition.AutoSize = true; - this.rbTransition.Checked = true; this.rbTransition.Location = new System.Drawing.Point(12, 26); this.rbTransition.Name = "rbTransition"; this.rbTransition.Size = new System.Drawing.Size(100, 17); this.rbTransition.TabIndex = 0; - this.rbTransition.TabStop = true; - this.rbTransition.Text = "Transitions Only"; + this.rbTransition.Text = "Refresh Transitions Only"; this.rbTransition.UseVisualStyleBackColor = true; this.rbTransition.Click += new System.EventHandler(this.Options_Changed); // + // rbUpdate + // + this.rbUpdate.AutoSize = true; + this.rbUpdate.Location = new System.Drawing.Point(12, 94); + this.rbUpdate.Name = "rbUpdate"; + this.rbUpdate.Size = new System.Drawing.Size(100, 17); + this.rbUpdate.TabIndex = 0; + this.rbUpdate.Text = "Update RO Values"; + this.rbUpdate.UseVisualStyleBackColor = true; + this.rbUpdate.Click += new System.EventHandler(this.Options_Changed); + // // myTV // this.myTV.CheckBoxes = true; @@ -307,7 +318,7 @@ namespace VEPROMS this.btnRefresh.Name = "btnRefresh"; this.btnRefresh.Size = new System.Drawing.Size(286, 28); this.btnRefresh.TabIndex = 1; - this.btnRefresh.Text = "Refresh selected option"; + this.btnRefresh.Text = "NO OPTION SELECTED"; this.btnRefresh.UseVisualStyleBackColor = true; this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click); // @@ -448,6 +459,7 @@ namespace VEPROMS private System.Windows.Forms.RadioButton rbBoth; private System.Windows.Forms.RadioButton rbRefObj; private System.Windows.Forms.RadioButton rbTransition; + private System.Windows.Forms.RadioButton rbUpdate; private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.Button btnSave; private System.Windows.Forms.Button btnClear; diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs index f94107c0..71be24d3 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs @@ -6,6 +6,8 @@ using System.Drawing; using System.Text; using System.Windows.Forms; using VEPROMS.CSLA.Library; +using System.IO; +using Volian.Controls.Library; namespace VEPROMS { @@ -38,42 +40,53 @@ namespace VEPROMS } //private DocVersionInfoList myDVIL; private Dictionary myProcedures = new Dictionary(); + private Dictionary myDocVersions = new Dictionary(); private void frmBatchRefresh_Load(object sender, EventArgs e) { - Options_Changed(rbTransition, e); - ResetTV(); + rbUpdate.Visible = false; + //Options_Changed(rbTransition, e); + //ResetTV(); } private void ResetTV() { + ResetTV(false); + } + private void ResetTV(bool noProcs) + { + this.Cursor = Cursors.WaitCursor; myTV.Nodes.Clear(); FolderInfo fi = FolderInfo.GetTop(); TreeNode tn = myTV.Nodes.Add(fi.Name); tn.Tag = fi; if (fi.ChildFolderCount > 0) - LoadChildFolders(fi, tn); + LoadChildFolders(fi, tn, noProcs); if (myTV.SelectedNode != null) myTV.SelectedNode.Expand(); + this.Cursor = Cursors.Default; } - private void LoadChildFolders(FolderInfo fi, TreeNode tn) + private void LoadChildFolders(FolderInfo fi, TreeNode tn, bool noProcs) { foreach (FolderInfo fic in fi.ChildFolders) { TreeNode tnc = tn.Nodes.Add(fic.Name); tnc.Tag = fic; if (fic.ChildFolderCount > 0) - LoadChildFolders(fic, tnc); + LoadChildFolders(fic, tnc, noProcs); if (fic.FolderDocVersionCount > 0) - LoadDocVersions(fic, tnc); + LoadDocVersions(fic, tnc, noProcs); } } - private void LoadDocVersions(FolderInfo fic, TreeNode tnc) + private void LoadDocVersions(FolderInfo fic, TreeNode tnc, bool noProcs) { foreach (DocVersionInfo dvi in fic.FolderDocVersions) { tnc.Tag = dvi; - - if (dvi.Procedures.Count > 0) - LoadProcedures(dvi, tnc); + myDocVersions.Add(tnc, dvi); + if (!noProcs) + { + if (dvi.Procedures.Count > 0) + LoadProcedures(dvi, tnc); + } } } private void LoadProcedures(DocVersionInfo dvi, TreeNode tnc) @@ -95,82 +108,191 @@ namespace VEPROMS } private void btnRefresh_Click(object sender, EventArgs e) { + if (btnRefresh.Text == "NO OPTION SELECTED") + { + MessageBox.Show("You must select an option under the Option panel", btnRefresh.Text); + return; + } this.Cursor = Cursors.WaitCursor; if (rbNow.Checked) { #region now - List pil = new List(); - foreach (TreeNode tn in myProcedures.Keys) - if (tn.Checked) - pil.Add(myProcedures[tn]); - PopulateTransitionInfoLists(pil); - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - pbProcess.Minimum = 0; - pbProcess.Maximum = pil.Count; - pbProcess.Step = 1; - while (pil.Count > 0) + if (rbUpdate.Checked) { - ContentInfo.StaticContentInfoChange += new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange); - StringBuilder sbProcs = new StringBuilder(); - Queue piq = new Queue(); - foreach (ProcedureInfo pi in pil) - piq.Enqueue(pi); - pil.Clear(); - while (piq.Count > 0) + List dvil = new List(); + foreach(TreeNode tn in myDocVersions.Keys) + if (tn.Checked) + dvil.Add(myDocVersions[tn]); + DateTime pStart = DateTime.Now; + txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText(Environment.NewLine); + Application.DoEvents(); + pbProcess.Minimum = 0; + pbProcess.Maximum = dvil.Count; + pbProcess.Step = 1; + while (dvil.Count > 0) { - string msg = string.Empty; - ProcedureInfo pq = piq.Dequeue(); - if (!MySessionInfo.CanCheckOutItem(pq.ItemID, CheckOutType.Procedure, ref msg)) + StringBuilder sbDocVersions = new StringBuilder(); + Queue dviq = new Queue(); + foreach (DocVersionInfo dvi in dvil) + dviq.Enqueue(dvi); + dvil.Clear(); + while (dviq.Count > 0) { - pil.Add(pq); - sbProcs.AppendLine(msg); - } - else - { - if (rbTransition.Checked) + string msg = string.Empty; + DocVersionInfo dq = dviq.Dequeue(); + if (!MySessionInfo.CanCheckOutItem(dq.VersionID, CheckOutType.DocVersion, ref msg)) { - RefreshProcedureTransitions(pq); - } - else if (rbRefObj.Checked) - { - RefreshProcedureReferencedObjects(pq); + dvil.Add(dq); + sbDocVersions.AppendLine(msg); } else { - RefreshProcedureTransitions(pq); - RefreshProcedureReferencedObjects(pq); + //InitialProgressBarMessage = "Updating ROs"; + if (dq.DocVersionAssociationCount < 1) + { + //FinalProgressBarMessage = "No ROs associated"; + MessageBox.Show("Error Updating ro.fst. No associated ro.fst"); + return; + } + ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst; + string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst"; + if (!File.Exists(rofstPath)) + { + //FinalProgressBarMessage = "No existing RO.FST"; + MessageBox.Show("No existing ro.fst in path " + roFstInfo.MyRODb.FolderPath + ". Check for invalid path"); + return; + } + FileInfo fiRofst = new FileInfo(rofstPath); + if (roFstInfo.DTS == fiRofst.LastWriteTimeUtc) + { + //FinalProgressBarMessage = "RO.FST up to date"; + MessageBox.Show("ro.fst files are same for path " + roFstInfo.MyRODb.FolderPath + ", import of that ro.fst will not be done"); + return; + } + if (roFstInfo.DTS > fiRofst.LastWriteTimeUtc) + { + //FinalProgressBarMessage = "RO.FST is older"; + MessageBox.Show("Cannot copy older ro.fst from " + roFstInfo.MyRODb.FolderPath + ", import of that ro.fst will not be done"); + return; + } + Cursor = Cursors.WaitCursor; + using (DocVersion dv = DocVersion.Get(dq.VersionID)) + { + roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); + ROFst newrofst = ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo, null);// DoProgressBarRefresh); + roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); + //StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST"); + //MyEditItem.MyStepPanel.OnTabDisplay(sender, args); + //btnUpdROVal.Enabled = false; + } + Cursor = Cursors.Default; + //FinalProgressBarMessage = "ROs values updated"; + pbProcess.PerformStep(); + Application.DoEvents(); } - pbProcess.PerformStep(); - Application.DoEvents(); + } + DateTime pEnd = DateTime.Now; + txtProcess.AppendText(pEnd.ToString("mm/dd/yyyy @ HH:mm")); + Application.DoEvents(); + if (dvil.Count > 0) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine("The batch update process was not usccessful for all working drafts selected."); + sb.AppendLine("The following working drafts were not able to be refreshed..."); + sb.AppendLine(); + sb.AppendLine(sbDocVersions.ToString()); + sb.AppendLine(); + sb.AppendLine("If you want to update these working drafts, please contact the respective users and have them close any procedures in the working draft."); + sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately."); + sb.AppendLine(); + sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?"); + frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(); + frmCO.MySessionInfo = MySessionInfo; + //frmCO.CheckedOutProcedures = dvil; + frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height); + frmCO.Show(this); + while (!this.Visible) + Application.DoEvents(); } } - ContentInfo.StaticContentInfoChange -= new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange); - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("mm/dd/yyyy @ HH:mm")); + } + else + { + List pil = new List(); + foreach (TreeNode tn in myProcedures.Keys) + if (tn.Checked) + pil.Add(myProcedures[tn]); + PopulateTransitionInfoLists(pil); + DateTime pStart = DateTime.Now; + txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText(Environment.NewLine); Application.DoEvents(); - if (pil.Count > 0) + pbProcess.Minimum = 0; + pbProcess.Maximum = pil.Count; + pbProcess.Step = 1; + while (pil.Count > 0) { - StringBuilder sb = new StringBuilder(); - sb.AppendLine("The batch refresh process was not usccessful for all procedures selected."); - sb.AppendLine("The following procedures were not able to be refreshed..."); - sb.AppendLine(); - sb.AppendLine(sbProcs.ToString()); - sb.AppendLine(); - sb.AppendLine("If you want to refresh these prcoedures, please contact the respective users and have them close the procedures."); - sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately."); - sb.AppendLine(); - sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?"); - frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(); - frmCO.MySessionInfo = MySessionInfo; - frmCO.CheckedOutProcedures = pil; - frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height); - frmCO.Show(this); - while (!this.Visible) - Application.DoEvents(); + ContentInfo.StaticContentInfoChange += new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange); + StringBuilder sbProcs = new StringBuilder(); + Queue piq = new Queue(); + foreach (ProcedureInfo pi in pil) + piq.Enqueue(pi); + pil.Clear(); + while (piq.Count > 0) + { + string msg = string.Empty; + ProcedureInfo pq = piq.Dequeue(); + if (!MySessionInfo.CanCheckOutItem(pq.ItemID, CheckOutType.Procedure, ref msg)) + { + pil.Add(pq); + sbProcs.AppendLine(msg); + } + else + { + if (rbTransition.Checked) + { + RefreshProcedureTransitions(pq); + } + else if (rbRefObj.Checked) + { + RefreshProcedureReferencedObjects(pq); + } + else + { + RefreshProcedureTransitions(pq); + RefreshProcedureReferencedObjects(pq); + } + pbProcess.PerformStep(); + Application.DoEvents(); + } + } + ContentInfo.StaticContentInfoChange -= new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange); + DateTime pEnd = DateTime.Now; + txtProcess.AppendText(pEnd.ToString("mm/dd/yyyy @ HH:mm")); + Application.DoEvents(); + if (pil.Count > 0) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine("The batch refresh process was not usccessful for all procedures selected."); + sb.AppendLine("The following procedures were not able to be refreshed..."); + sb.AppendLine(); + sb.AppendLine(sbProcs.ToString()); + sb.AppendLine(); + sb.AppendLine("If you want to refresh these prcoedures, please contact the respective users and have them close the procedures."); + sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately."); + sb.AppendLine(); + sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?"); + frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(); + frmCO.MySessionInfo = MySessionInfo; + frmCO.CheckedOutProcedures = pil; + frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height); + frmCO.Show(this); + while (!this.Visible) + Application.DoEvents(); + } } } #endregion @@ -187,77 +309,83 @@ namespace VEPROMS System.Threading.Thread.Sleep(60000); now = long.Parse(DateTime.Now.ToString("yyyyMMddHHmm")); } - List pil = new List(); - foreach (TreeNode tn in myProcedures.Keys) - if (tn.Checked) - pil.Add(myProcedures[tn]); - DateTime pStart = DateTime.Now; - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(pStart.ToString("mm/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - pbProcess.Minimum = 0; - pbProcess.Maximum = pil.Count; - pbProcess.Step = 1; - while (pil.Count > 0) + if (rbUpdate.Checked) { - ContentInfo.StaticContentInfoChange += new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange); - StringBuilder sbProcs = new StringBuilder(); - Queue piq = new Queue(); - foreach (ProcedureInfo pi in pil) - piq.Enqueue(pi); - pil.Clear(); - while (piq.Count > 0) + } + else + { + List pil = new List(); + foreach (TreeNode tn in myProcedures.Keys) + if (tn.Checked) + pil.Add(myProcedures[tn]); + DateTime pStart = DateTime.Now; + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText(Environment.NewLine); + Application.DoEvents(); + pbProcess.Minimum = 0; + pbProcess.Maximum = pil.Count; + pbProcess.Step = 1; + while (pil.Count > 0) { - string msg = string.Empty; - ProcedureInfo pq = piq.Dequeue(); - if (!MySessionInfo.CanCheckOutItem(pq.ItemID, CheckOutType.Procedure, ref msg)) + ContentInfo.StaticContentInfoChange += new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange); + StringBuilder sbProcs = new StringBuilder(); + Queue piq = new Queue(); + foreach (ProcedureInfo pi in pil) + piq.Enqueue(pi); + pil.Clear(); + while (piq.Count > 0) { - pil.Add(pq); - sbProcs.AppendLine(msg); - } - else - { - if (rbTransition.Checked) + string msg = string.Empty; + ProcedureInfo pq = piq.Dequeue(); + if (!MySessionInfo.CanCheckOutItem(pq.ItemID, CheckOutType.Procedure, ref msg)) { - RefreshProcedureTransitions(pq); - } - else if (rbRefObj.Checked) - { - RefreshProcedureReferencedObjects(pq); + pil.Add(pq); + sbProcs.AppendLine(msg); } else { - RefreshProcedureTransitions(pq); - RefreshProcedureReferencedObjects(pq); + if (rbTransition.Checked) + { + RefreshProcedureTransitions(pq); + } + else if (rbRefObj.Checked) + { + RefreshProcedureReferencedObjects(pq); + } + else + { + RefreshProcedureTransitions(pq); + RefreshProcedureReferencedObjects(pq); + } + pbProcess.PerformStep(); + Application.DoEvents(); } - pbProcess.PerformStep(); + } + ContentInfo.StaticContentInfoChange -= new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange); + DateTime pEnd = DateTime.Now; + txtProcess.AppendText(pEnd.ToString("mm/dd/yyyy @ HH:mm")); + Application.DoEvents(); + if (pil.Count > 0) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine("The batch refresh process was not usccessful for all procedures selected."); + sb.AppendLine("The following procedures were not able to be refreshed..."); + sb.AppendLine(); + sb.AppendLine(sbProcs.ToString()); + sb.AppendLine(); + sb.AppendLine("These procedures were forced checked in and the process was allowed to complete."); + foreach (ProcedureInfo pi in pil) + { + OwnerInfo oi = OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure); + MySessionInfo.CheckInItem(oi.OwnerID); + } + txtProcess.AppendText(sb.ToString()); + txtProcess.AppendText(Environment.NewLine); Application.DoEvents(); } } - ContentInfo.StaticContentInfoChange -= new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange); - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("mm/dd/yyyy @ HH:mm")); - Application.DoEvents(); - if (pil.Count > 0) - { - StringBuilder sb = new StringBuilder(); - sb.AppendLine("The batch refresh process was not usccessful for all procedures selected."); - sb.AppendLine("The following procedures were not able to be refreshed..."); - sb.AppendLine(); - sb.AppendLine(sbProcs.ToString()); - sb.AppendLine(); - sb.AppendLine("These procedures were forced checked in and the process was allowed to complete."); - foreach (ProcedureInfo pi in pil) - { - OwnerInfo oi = OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure); - MySessionInfo.CheckInItem(oi.OwnerID); - } - txtProcess.AppendText(sb.ToString()); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - } } #endregion } @@ -291,7 +419,10 @@ namespace VEPROMS txtResults.AppendText(myFixes.ToString()); txtResults.AppendText(Environment.NewLine); } - + public List roFstInfo_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args) + { + return VlnFlexGrid.ROTableUpdate(sender, args); + } private void PopulateTransitionInfoLists(List pil) { Dictionary dic = new Dictionary(); @@ -355,8 +486,15 @@ namespace VEPROMS } private void Options_Changed(object sender, EventArgs e) { - if ((sender as RadioButton).Checked) - btnRefresh.Text = string.Format("Refresh {0}", (sender as RadioButton).Text); + RadioButton rb = sender as RadioButton; + if (rb.Checked) + { + btnRefresh.Text = (sender as RadioButton).Text; + if (rb == rbUpdate) + ResetTV(true); + else + ResetTV(); + } } private void myTV_AfterCheck(object sender, TreeViewEventArgs e) {