Added code to make Summary of Changes report the same as the 16-bit Summary of Changes Report

This commit is contained in:
Rich 2013-09-12 19:24:59 +00:00
parent cfb8e68c9f
commit 54db0e1e81

View File

@ -1007,7 +1007,7 @@ namespace Volian.Print.Library
ContentAuditInfo firstCAI = null;
ContentAuditInfo nextCAI = null;
ContentAuditInfo lastCAI = null;
List<ContentAuditInfo> auditList = new List<ContentAuditInfo>();
List<ContentAuditInfo> auditList1 = new List<ContentAuditInfo>();
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<ContentAuditInfo> auditList2 = new List<ContentAuditInfo>();
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<long, AnnotationAuditInfo> processedAAI = new Dictionary<long, AnnotationAuditInfo>();
Dictionary<AnnotationAuditInfo, AnnotationAuditInfo> processedAAI = new Dictionary<AnnotationAuditInfo, AnnotationAuditInfo>();
foreach (ContentAuditInfo cai in auditList)
foreach (ContentAuditInfo cai in auditList2)
{
//raw path
string[] NewPath = SplitPath(cai.Path);