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
This commit is contained in:
Rich 2012-04-04 19:08:56 +00:00
parent 74097dc316
commit b4e85fd3b0
7 changed files with 113 additions and 16 deletions

View File

@ -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()

View File

@ -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);

View File

@ -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);
}
/// <summary>

View File

@ -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);

View File

@ -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

Binary file not shown.

View File

@ -426,6 +426,7 @@ namespace Volian.Print.Library
}
}
bool annotationHeader = false;
section = string.Empty;
stepnum = string.Empty;
foreach (AnnotationAuditInfo aai in AnnotationList)
{
@ -448,6 +449,20 @@ namespace Volian.Print.Library
annotationHeader = true;
}
string[] NewPath = GetNewPath(AuditList, aai.IContentID);
if (NewPath[0] != section)
{
section = NewPath[0];
stepnum = string.Empty;
h = new Phrase();
h.Font = f4;
h.Add(section);
c = new PdfPCell(h);
c.Colspan = cols;
c.HorizontalAlignment = Element.ALIGN_LEFT;
c.PaddingBottom = paddingBottom;
//c.Border = borders;
t.AddCell(c);
}
if (NewPath[1] != stepnum)
{
stepnum = NewPath[1];
@ -1077,10 +1092,6 @@ namespace Volian.Print.Library
annotationList.Add(firstAAI);
annotationList.Add(lastAAI);
}
else if (lastAAI.ActionWhat == "Changed" && firstAAI.ActionWhat == "Added") // && lastAAI.SearchText == firstAAI.SearchText)
{
annotationList.Add(firstAAI);
}
else if (lastAAI.ActionWhat == "Changed" && firstAAI.ActionWhat == "Added") // && lastAAI.SearchText != firstAAI.SearchText)
{
lastAAI.ActionWhat = firstAAI.ActionWhat;
@ -1107,9 +1118,43 @@ namespace Volian.Print.Library
lastAAI = aai;
}
if (firstAAI != null)
annotationList.Add(firstAAI);
if (lastAAI != null)
annotationList.Add(lastAAI);
{
if (lastAAI == null)
{
annotationList.Add(firstAAI);
}
else if (lastAAI.ActionWhat == "Deleted" && firstAAI.DTS < MyProc.DTS)
{
annotationList.Add(lastAAI);
}
else if (lastAAI.ActionWhat == "Changed" && firstAAI.ActionWhat != "Added") // && lastAAI.SearchText != firstAAI.SearchText)
{
annotationList.Add(firstAAI);
annotationList.Add(lastAAI);
}
else if (lastAAI.ActionWhat == "Changed" && firstAAI.ActionWhat == "Added") // && lastAAI.SearchText != firstAAI.SearchText)
{
lastAAI.ActionWhat = firstAAI.ActionWhat;
annotationList.Add(lastAAI);
firstAAI = null;
lastAAI = null;
}
else if (lastAAI.ActionWhat == "Restored" && firstAAI.ActionWhat == "Added") // && lastAAI.SearchText != firstAAI.SearchText)
{
lastAAI.ActionWhat = firstAAI.ActionWhat;
annotationList.Add(lastAAI);
firstAAI = null;
lastAAI = null;
}
else if (lastAAI == null && firstAAI.ActionWhat == "Added")
{
annotationList.Add(firstAAI);
}
}
//if (firstAAI != null)
// annotationList.Add(firstAAI);
//if (lastAAI != null)
// annotationList.Add(lastAAI);
#endregion
int cols = 5;
int borders = 0;
@ -1421,6 +1466,7 @@ namespace Volian.Print.Library
////c.Border = borders;
//t.AddCell(c);
//t.AddCell(BlankCell(cols));
section = string.Empty;
stepnum = string.Empty;
foreach (AnnotationAuditInfo aai in annotationList)
{
@ -1443,6 +1489,20 @@ namespace Volian.Print.Library
annotationHeader = true;
}
string[] NewPath = GetNewPath(AuditList, aai.IContentID);
if (NewPath[0] != section)
{
section = NewPath[0];
stepnum = string.Empty;
h = new Phrase();
h.Font = f4;
h.Add(section);
c = new PdfPCell(h);
c.Colspan = cols;
c.HorizontalAlignment = Element.ALIGN_LEFT;
c.PaddingBottom = paddingBottom;
//c.Border = borders;
t.AddCell(c);
}
if (NewPath[1] != stepnum)
{
stepnum = NewPath[1];