From b4e85fd3b0c5c579a4a443536b9b0e52c8368233 Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 4 Apr 2012 19:08:56 +0000 Subject: [PATCH] Fix to UpdateTransitionText for bugs B2012-071 and B2012-079 One ContentAudit for all transitions Indentify Automatic Transition renumbering with current user If the user selects a deleted item from history, a messagebox is displayed Include deleted items in the Change List Fixed CloseTabItem so that closed DockTab fires events Added event handler for changes to the procedure content so that updating the Rev Date and Rev Number will refresh the step item change bars Remove event handler for changes to the procedure content on dispose Added Section headers for the Annotation portion of the Chronology and Summary reports --- .../Extension/ItemInsertExt.cs | 41 ++++++++-- .../Volian.Controls.Library/DisplayHistory.cs | 9 ++- .../DisplayTabControl.cs | 3 +- PROMS/Volian.Controls.Library/EditItem.cs | 1 + .../GridItem.Designer.cs | 1 + .../RTBItem.designer.cs | Bin 16260 -> 16480 bytes .../PDFChronologyReport.cs | 74 ++++++++++++++++-- 7 files changed, 113 insertions(+), 16 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index e4880d74..d712d9fa 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -422,20 +422,49 @@ namespace VEPROMS.CSLA.Library // This returns a list of all of the transitions that may have been affected using(TransitionInfoList trans = TransitionInfoList.GetAffected(this.ItemID)) { + #region B2012-071 fix JCB + Content oldContent = null; foreach (TransitionInfo tran in trans) { using (Content content = tran.MyContent.Get()) { - content.FixTransitionText(tran); - if (content.IsDirty) + if (oldContent != null && content.ContentID != oldContent.ContentID) { - content.DTS = DateTime.Now; - content.Save(); + if (oldContent.IsDirty) + { + oldContent.DTS = DateTime.Now; + #region B2012-079 fix JCB + oldContent.UserID = Volian.Base.Library.VlnSettings.UserID + " - Renumber"; + #endregion B2012-079 fix JCB + oldContent.Save(); + } + else // Update ContentInfo objects to reflect the change in the transition + ContentInfo.Refresh(oldContent); + oldContent = content; } - else // Update ContentInfo objects to reflect the change in the transition - ContentInfo.Refresh(content); + if (oldContent == null) oldContent = content; + oldContent.FixTransitionText(tran); + //if (content.IsDirty) + //{ + // content.DTS = DateTime.Now; + // content.Save(); + //} } } + if (oldContent != null) + { + if (oldContent.IsDirty) + { + oldContent.DTS = DateTime.Now; + #region B2012-079 fix JCB + oldContent.UserID = Volian.Base.Library.VlnSettings.UserID + " - Renumber"; + #endregion B2012-079 fix JCB + oldContent.Save(); + } + else // Update ContentInfo objects to reflect the change in the transition + ContentInfo.Refresh(oldContent); + } + #endregion B2012-071 fix JCB } } public void UpdatePastedStepTransitionText() diff --git a/PROMS/Volian.Controls.Library/DisplayHistory.cs b/PROMS/Volian.Controls.Library/DisplayHistory.cs index cd65fbff..5df81846 100644 --- a/PROMS/Volian.Controls.Library/DisplayHistory.cs +++ b/PROMS/Volian.Controls.Library/DisplayHistory.cs @@ -117,7 +117,12 @@ namespace Volian.Controls.Library { ContentAuditInfo cai = lbChanges.SelectedItem as ContentAuditInfo; if (cai != null) - OnHistorySelectionChanged(new DisplayHistoryEventArgs(cai.ItemID)); + { + if (cai.DeleteStatus > 0) + MessageBox.Show("This item has been deleted.","Deleted Item",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); + else + OnHistorySelectionChanged(new DisplayHistoryEventArgs(cai.ItemID)); + } else { AnnotationAuditInfo aai = lbChanges.SelectedItem as AnnotationAuditInfo; @@ -415,7 +420,7 @@ namespace Volian.Controls.Library _AnnotationList = aail2; foreach (ContentAuditInfo cai in cail2) { - if (cai.DTS > MyProcedureInfo.DTS) + if (cai.DTS > MyProcedureInfo.DTS || cai.ActionWhen > MyProcedureInfo.DTS) { string itemTitle = FixPath(cai.Path); lbChanges.Items.Add(cai); diff --git a/PROMS/Volian.Controls.Library/DisplayTabControl.cs b/PROMS/Volian.Controls.Library/DisplayTabControl.cs index a5bc3166..22f345c6 100644 --- a/PROMS/Volian.Controls.Library/DisplayTabControl.cs +++ b/PROMS/Volian.Controls.Library/DisplayTabControl.cs @@ -464,7 +464,8 @@ namespace Volian.Controls.Library private void CloseTabItem(DisplayTabItem myTabItem) { Bar b = myTabItem.ContainerControl as Bar; - b.Items.Remove(myTabItem); + b.CloseDockTab(myTabItem); + //b.Items.Remove(myTabItem); RemoveItem(myTabItem); } /// diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index d82e9e29..1d9ab027 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -189,6 +189,7 @@ namespace Volian.Controls.Library } // Deal with changes in content data value.MyContent.Changed += new ContentInfoEvent(MyContent_Changed); + value.MyProcedure.MyContent.Changed += new ContentInfoEvent(MyContent_Changed); // Deal with change in item data value.Changed += new ItemInfoEvent(value_Changed); value.OrdinalChanged += new ItemInfoEvent(value_OrdinalChanged); diff --git a/PROMS/Volian.Controls.Library/GridItem.Designer.cs b/PROMS/Volian.Controls.Library/GridItem.Designer.cs index 966e5844..a96438c1 100644 --- a/PROMS/Volian.Controls.Library/GridItem.Designer.cs +++ b/PROMS/Volian.Controls.Library/GridItem.Designer.cs @@ -19,6 +19,7 @@ namespace Volian.Controls.Library } base.Dispose(disposing); MyItemInfo.MyContent.Changed -= new VEPROMS.CSLA.Library.ContentInfoEvent(MyContent_Changed); + MyItemInfo.MyProcedure.MyContent.Changed -= new VEPROMS.CSLA.Library.ContentInfoEvent(MyContent_Changed); } #region Component Designer generated code diff --git a/PROMS/Volian.Controls.Library/RTBItem.designer.cs b/PROMS/Volian.Controls.Library/RTBItem.designer.cs index fe02326cc3e5d2214833a4a5d16742f93a741c2a..f7a644397242041046f93714dfe1f20694bc193a 100644 GIT binary patch delta 35 pcmZpvf6&0V!G>*e1*?o;07DT&K0`7?DnklGDUhAIxtI03B>=|S3bFtI delta 28 kcmaFRz}Qm1!G>+}89T1Y5{v?q)tDtF$FPVkPGGkL0F