From 54db0e1e81965a79f6bca7d28319af8277a4bc9c Mon Sep 17 00:00:00 2001 From: Rich Date: Thu, 12 Sep 2013 19:24:59 +0000 Subject: [PATCH] Added code to make Summary of Changes report the same as the 16-bit Summary of Changes Report --- .../PDFChronologyReport.cs | 50 +++++++++++++------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/PROMS/Volian.Print.Library/PDFChronologyReport.cs b/PROMS/Volian.Print.Library/PDFChronologyReport.cs index 8ab81a52..23ad9841 100644 --- a/PROMS/Volian.Print.Library/PDFChronologyReport.cs +++ b/PROMS/Volian.Print.Library/PDFChronologyReport.cs @@ -1007,7 +1007,7 @@ namespace Volian.Print.Library ContentAuditInfo firstCAI = null; ContentAuditInfo nextCAI = null; ContentAuditInfo lastCAI = null; - List auditList = new List(); + List auditList1 = new List(); foreach (ContentAuditInfo cai in AuditList) { if (MyProc.MyLookup == null || MyProc.MyLookup.ContainsKey(cai.ItemID)) @@ -1018,7 +1018,7 @@ namespace Volian.Print.Library { if (lastCAI == null) { - auditList.Add(firstCAI); + auditList1.Add(firstCAI); firstCAI = null; } else @@ -1032,15 +1032,15 @@ namespace Volian.Print.Library //this step was originally commented out, then jcb un commented it, but we saw a summary report that had 2 added rows //for the same step which is highly undesirable, so we commented it out again 1/17/2012 //for example we added 2 steps, then make a change to 1st step added - //auditList.Add(firstCAI); //jcb uncommented - auditList.Add(lastCAI); + auditList1.Add(firstCAI); //jcb uncommented + auditList1.Add(lastCAI); firstCAI = null; lastCAI = null; } else if (firstCAI.ActionWhat == lastCAI.ActionWhat) { - auditList.Add(firstCAI); - auditList.Add(lastCAI); + auditList1.Add(firstCAI); + auditList1.Add(lastCAI); firstCAI = null; lastCAI = null; } @@ -1059,7 +1059,7 @@ namespace Volian.Print.Library else if (firstCAI.ActionWhat == "Added" && lastCAI.ActionWhat == "Changed" && firstCAI.DTS > MyProc.ChangeBarDate) { lastCAI.ActionWhat = firstCAI.ActionWhat; - auditList.Add(lastCAI); + auditList1.Add(lastCAI); firstCAI = null; lastCAI = null; } @@ -1084,7 +1084,7 @@ namespace Volian.Print.Library if (lastCAI == null) { if (firstCAI != null) - auditList.Add(firstCAI); + auditList1.Add(firstCAI); firstCAI = null; } else @@ -1095,15 +1095,15 @@ namespace Volian.Print.Library { if (firstCAI.DTS > MyProc.ChangeBarDate) lastCAI.ActionWhat = firstCAI.ActionWhat; - //auditList.Add(firstCAI); - auditList.Add(lastCAI); + auditList1.Add(firstCAI); + auditList1.Add(lastCAI); firstCAI = null; lastCAI = null; } else if (firstCAI.ActionWhat == lastCAI.ActionWhat) { - auditList.Add(firstCAI); - auditList.Add(lastCAI); + auditList1.Add(firstCAI); + auditList1.Add(lastCAI); firstCAI = null; lastCAI = null; } @@ -1124,7 +1124,7 @@ namespace Volian.Print.Library else if (lastCAI.ActionWhat != "Deleted") { lastCAI.ActionWhat = firstCAI.ActionWhat; - auditList.Add(lastCAI); + auditList1.Add(lastCAI); lastCAI = null; } @@ -1223,6 +1223,28 @@ namespace Volian.Print.Library //if (lastAAI != null) // annotationList.Add(lastAAI); #endregion + //new final cleanup + List auditList2 = new List(); + ContentAuditInfo caiFirst = null; + foreach (ContentAuditInfo cai in auditList1) + { + if (caiFirst == null) + caiFirst = cai; + else + { + if (cai.ContentID == caiFirst.ContentID && cai.Text != caiFirst.Text) + { + if (caiFirst.ActionWhat == "Added" && (cai.ActionWhat == "Added" || cai.ActionWhat == "Restored")) + auditList2.Add(cai); + else + { + auditList2.Add(caiFirst); + auditList2.Add(cai); + } + } + caiFirst = null; + } + } int cols = 5; int borders = 0; int paddingBottom = 6; @@ -1264,7 +1286,7 @@ namespace Volian.Print.Library string oldTypeName = string.Empty; // Dictionary processedAAI = new Dictionary(); Dictionary processedAAI = new Dictionary(); - foreach (ContentAuditInfo cai in auditList) + foreach (ContentAuditInfo cai in auditList2) { //raw path string[] NewPath = SplitPath(cai.Path);