changes to support approval process
fixes to change manager
This commit is contained in:
@@ -11,6 +11,21 @@ namespace Volian.Print.Library
|
||||
{
|
||||
public class PDFChronologyReport
|
||||
{
|
||||
private static Dictionary<int, string> _AnnotationLookup;
|
||||
public static Dictionary<int, string> AnnotationLookup
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_AnnotationLookup == null)
|
||||
{
|
||||
_AnnotationLookup = new Dictionary<int, string>();
|
||||
AnnotationTypeInfoList atil = AnnotationTypeInfoList.Get();
|
||||
foreach (AnnotationTypeInfo ati in atil)
|
||||
_AnnotationLookup.Add(ati.TypeID, ati.Name);
|
||||
}
|
||||
return _AnnotationLookup;
|
||||
}
|
||||
}
|
||||
private string _FileName;
|
||||
public string FileName
|
||||
{
|
||||
@@ -71,6 +86,10 @@ namespace Volian.Print.Library
|
||||
}
|
||||
}
|
||||
public void BuildSummary()
|
||||
{
|
||||
BuildSummary(true);
|
||||
}
|
||||
public void BuildSummary(bool openReport)
|
||||
{
|
||||
bool hasData = false;
|
||||
iTextSharp.text.Document document = new iTextSharp.text.Document(PageSize.LETTER, 36, 36, 36, 36);
|
||||
@@ -78,6 +97,7 @@ namespace Volian.Print.Library
|
||||
try
|
||||
{
|
||||
BuildSummaryReport(document);
|
||||
//BuildSummaryReport2(document);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -95,7 +115,8 @@ namespace Volian.Print.Library
|
||||
if (document.IsOpen())
|
||||
{
|
||||
document.Close();
|
||||
System.Diagnostics.Process.Start(_FileName);
|
||||
if(openReport)
|
||||
System.Diagnostics.Process.Start(_FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -159,6 +180,7 @@ namespace Volian.Print.Library
|
||||
}
|
||||
private void BuildChronologyReport(iTextSharp.text.Document doc)
|
||||
{
|
||||
int lastAnnotationID = 0;
|
||||
int cols = 5;
|
||||
int borders = 0;
|
||||
int paddingBottom = 6;
|
||||
@@ -200,6 +222,8 @@ namespace Volian.Print.Library
|
||||
DateTime maxDTS = DateTime.MinValue;
|
||||
int lastID = 0;
|
||||
ContentAuditInfo oldCAI = null;
|
||||
string oldText = string.Empty;
|
||||
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)
|
||||
@@ -208,6 +232,7 @@ namespace Volian.Print.Library
|
||||
string[] NewPath = SplitPath(cai.Path);
|
||||
if (NewPath[0] != section)
|
||||
{
|
||||
AddStepAnnotation(ref lastAnnotationID, cols, paddingBottom, t, f3, f4, ref h, ref c, oldCAI, processedAAI);
|
||||
section = NewPath[0];
|
||||
h = new Phrase();
|
||||
h.Font = f4;
|
||||
@@ -223,59 +248,10 @@ namespace Volian.Print.Library
|
||||
//step
|
||||
if (NewPath[1] != stepnum)
|
||||
{
|
||||
//see if any annotations for old stepnum here and add them
|
||||
foreach (AnnotationAuditInfo aai in AnnotationList)
|
||||
{
|
||||
if (oldCAI != null && aai.IContentID == oldCAI.ContentID)
|
||||
{
|
||||
//add annotation to minilist
|
||||
// processedAAI.Add(aai.AnnotationID, aai);
|
||||
processedAAI.Add(aai, aai);
|
||||
//write row to table
|
||||
t.AddCell(BlankCell(1));
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
h.Add("Annotation " + aai.ActionWhat);
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
c.PaddingBottom = paddingBottom;
|
||||
//c.Border = borders;
|
||||
t.AddCell(c);
|
||||
//who
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
h.Add(aai.UserID);
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
c.PaddingBottom = paddingBottom;
|
||||
//c.Border = borders;
|
||||
t.AddCell(c);
|
||||
//when
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
h.Add(aai.ActionWhen.ToString());
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
c.PaddingBottom = paddingBottom;
|
||||
//c.Border = borders;
|
||||
t.AddCell(c);
|
||||
//new text
|
||||
h = new Phrase();
|
||||
h.Font = f4;
|
||||
//h.Add(cai.Text);
|
||||
h.Add(ItemInfo.ConvertToDisplayText(aai.SearchText));
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = cols - 4;
|
||||
c.HorizontalAlignment = Element.ALIGN_LEFT;
|
||||
c.PaddingBottom = paddingBottom;
|
||||
//c.Border = borders;
|
||||
t.AddCell(c);
|
||||
}
|
||||
}
|
||||
AddStepAnnotation(ref lastAnnotationID, cols, paddingBottom, t, f3, f4, ref h, ref c, oldCAI, processedAAI);
|
||||
oldCAI = cai;
|
||||
oldText = cai.Text;
|
||||
oldTypeName = cai.TypeName;
|
||||
stepnum = NewPath[1];
|
||||
string stepnum2 = Regex.Replace(stepnum, "([0-9])[.]([A-Za-z])", "$1 $2");
|
||||
stepnum2 = stepnum2.Replace("RNO.", "RNO");
|
||||
@@ -366,7 +342,14 @@ namespace Volian.Print.Library
|
||||
{
|
||||
h = new Phrase();
|
||||
h.Font = f4;
|
||||
h.Add(ItemInfo.ConvertToDisplayText(cai.Text));
|
||||
if (cai.Text != oldText && cai.TypeName != oldTypeName)
|
||||
h.Add(string.Format("[Type Change {0} to {1}] - {2}", oldTypeName, cai.TypeName, ItemInfo.ConvertToDisplayText(cai.Text)));// + " to " + cai.TypeName);
|
||||
else if (cai.Text == oldText && cai.TypeName != oldTypeName)
|
||||
h.Add(oldTypeName + " to " + cai.TypeName);
|
||||
else
|
||||
h.Add(ItemInfo.ConvertToDisplayText(cai.Text));
|
||||
oldText = cai.Text;
|
||||
oldTypeName = cai.TypeName;
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = cols - 4;
|
||||
c.HorizontalAlignment = Element.ALIGN_LEFT;
|
||||
@@ -396,7 +379,13 @@ namespace Volian.Print.Library
|
||||
t.AddCell(BlankCell(1));
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
h.Add("Annotation " + aai.ActionWhat);
|
||||
if (aai.AnnotationID != lastAnnotationID)
|
||||
{
|
||||
lastAnnotationID = aai.AnnotationID;
|
||||
h.Add(AnnotationLookup[aai.TypeID] + " " + aai.ActionWhat);
|
||||
}
|
||||
else
|
||||
h.Add(aai.ActionWhat);
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
@@ -482,7 +471,13 @@ namespace Volian.Print.Library
|
||||
//what
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
h.Add(aai.ActionWhat);
|
||||
if (aai.AnnotationID != lastAnnotationID)
|
||||
{
|
||||
lastAnnotationID = aai.AnnotationID;
|
||||
h.Add(AnnotationLookup[aai.TypeID] + " " + aai.ActionWhat);
|
||||
}
|
||||
else
|
||||
h.Add(aai.ActionWhat);
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
@@ -530,6 +525,70 @@ namespace Volian.Print.Library
|
||||
}
|
||||
doc.Add(t);
|
||||
}
|
||||
|
||||
private void AddStepAnnotation(ref int lastAnnotationID, int cols, int paddingBottom, PdfPTable t, iTextSharp.text.Font f3, iTextSharp.text.Font f4, ref Phrase h, ref PdfPCell c, ContentAuditInfo oldCAI, Dictionary<AnnotationAuditInfo, AnnotationAuditInfo> processedAAI)
|
||||
{
|
||||
//see if any annotations for old stepnum here and add them
|
||||
foreach (AnnotationAuditInfo aai in AnnotationList)
|
||||
{
|
||||
if (oldCAI != null && aai.IContentID == oldCAI.ContentID)
|
||||
{
|
||||
//add annotation to minilist
|
||||
// processedAAI.Add(aai.AnnotationID, aai);
|
||||
if(processedAAI.ContainsKey(aai))
|
||||
return;
|
||||
processedAAI.Add(aai, aai);
|
||||
//write row to table
|
||||
t.AddCell(BlankCell(1));
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
if (aai.AnnotationID != lastAnnotationID)
|
||||
{
|
||||
lastAnnotationID = aai.AnnotationID;
|
||||
h.Add(AnnotationLookup[aai.TypeID] + " " + aai.ActionWhat);
|
||||
}
|
||||
else
|
||||
h.Add(aai.ActionWhat);
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
c.PaddingBottom = paddingBottom;
|
||||
//c.Border = borders;
|
||||
t.AddCell(c);
|
||||
//who
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
h.Add(aai.UserID);
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
c.PaddingBottom = paddingBottom;
|
||||
//c.Border = borders;
|
||||
t.AddCell(c);
|
||||
//when
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
h.Add(aai.ActionWhen.ToString());
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
c.PaddingBottom = paddingBottom;
|
||||
//c.Border = borders;
|
||||
t.AddCell(c);
|
||||
//new text
|
||||
h = new Phrase();
|
||||
h.Font = f4;
|
||||
//h.Add(cai.Text);
|
||||
h.Add(ItemInfo.ConvertToDisplayText(aai.SearchText));
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = cols - 4;
|
||||
c.HorizontalAlignment = Element.ALIGN_LEFT;
|
||||
c.PaddingBottom = paddingBottom;
|
||||
//c.Border = borders;
|
||||
t.AddCell(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
private static string[] SplitPath(string path)
|
||||
{
|
||||
// Remove Procedure Number and Title
|
||||
@@ -538,7 +597,6 @@ namespace Volian.Print.Library
|
||||
// Split Section frrom Steps
|
||||
return sectionAndStep.Split("\x7".ToCharArray());
|
||||
}
|
||||
|
||||
private string[] GetNewPath(ContentAuditInfoList AuditList, int contentID)
|
||||
{
|
||||
foreach (ContentAuditInfo cai in AuditList)
|
||||
@@ -866,6 +924,7 @@ namespace Volian.Print.Library
|
||||
}
|
||||
private void BuildSummaryReport(iTextSharp.text.Document doc)
|
||||
{
|
||||
int lastAnnotationID = 0;
|
||||
string section = string.Empty;
|
||||
string stepnum = string.Empty;
|
||||
int contentID = 0;
|
||||
@@ -892,11 +951,26 @@ namespace Volian.Print.Library
|
||||
{
|
||||
if (firstCAI.DTS > MyProc.DTS)
|
||||
lastCAI.ActionWhat = firstCAI.ActionWhat;
|
||||
//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);
|
||||
firstCAI = null;
|
||||
lastCAI = null;
|
||||
}
|
||||
else if (firstCAI.ActionWhat == lastCAI.ActionWhat)
|
||||
{
|
||||
auditList.Add(firstCAI);
|
||||
auditList.Add(lastCAI);
|
||||
firstCAI = null;
|
||||
lastCAI = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
firstCAI = null;
|
||||
lastCAI = null;
|
||||
}
|
||||
}
|
||||
else if (firstCAI.ActionWhat == "Added" && lastCAI.ActionWhat == "Deleted" && firstCAI.DTS == lastCAI.DTS)
|
||||
{
|
||||
@@ -904,9 +978,25 @@ namespace Volian.Print.Library
|
||||
firstCAI = null;
|
||||
lastCAI = null;
|
||||
}
|
||||
else if (firstCAI.ActionWhat == "Added" && lastCAI.ActionWhat == "Changed" && firstCAI.DTS > MyProc.DTS)
|
||||
{
|
||||
lastCAI.ActionWhat = firstCAI.ActionWhat;
|
||||
auditList.Add(lastCAI);
|
||||
firstCAI = null;
|
||||
lastCAI = null;
|
||||
}
|
||||
//added by jcb
|
||||
//else if (firstCAI.ActionWhat == "Added" && lastCAI.ActionWhat == "Changed" && firstCAI.DTS == lastCAI.DTS)
|
||||
//{
|
||||
// auditList.Add(firstCAI);
|
||||
// auditList.Add(lastCAI);
|
||||
// firstCAI = null;
|
||||
// lastCAI = null;
|
||||
//}
|
||||
}
|
||||
}
|
||||
firstCAI = cai;
|
||||
lastCAI = null;
|
||||
contentID = cai.ContentID;
|
||||
}
|
||||
else
|
||||
@@ -926,64 +1016,100 @@ namespace Volian.Print.Library
|
||||
{
|
||||
if (firstCAI.DTS > MyProc.DTS)
|
||||
lastCAI.ActionWhat = firstCAI.ActionWhat;
|
||||
//auditList.Add(firstCAI);
|
||||
auditList.Add(lastCAI);
|
||||
firstCAI = null;
|
||||
lastCAI = null;
|
||||
}
|
||||
else if (firstCAI.ActionWhat == lastCAI.ActionWhat)
|
||||
{
|
||||
auditList.Add(firstCAI);
|
||||
auditList.Add(lastCAI);
|
||||
firstCAI = null;
|
||||
lastCAI = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
firstCAI = null;
|
||||
lastCAI = null;
|
||||
}
|
||||
}
|
||||
else if (firstCAI.ActionWhat == "Added" && lastCAI.ActionWhat == "Deleted" && firstCAI.DTS == lastCAI.DTS)
|
||||
else if (firstCAI.ActionWhat == "Added")
|
||||
{
|
||||
//auditList.Add(lastCAI);
|
||||
firstCAI = null;
|
||||
lastCAI = null;
|
||||
if (lastCAI.ActionWhat == "Deleted" && firstCAI.DTS == lastCAI.DTS)
|
||||
{
|
||||
//auditList.Add(lastCAI);
|
||||
firstCAI = null;
|
||||
lastCAI = null;
|
||||
}
|
||||
else if (lastCAI.ActionWhat != "Deleted")
|
||||
{
|
||||
lastCAI.ActionWhat = firstCAI.ActionWhat;
|
||||
auditList.Add(lastCAI);
|
||||
lastCAI = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#region annotations commented out
|
||||
//AnnotationAuditInfo firstAAI = null;
|
||||
//AnnotationAuditInfo nextAAI = null;
|
||||
//AnnotationAuditInfo lastAAI = null;
|
||||
//int icontentID = 0;
|
||||
//List<AnnotationAuditInfo> annotationList = new List<AnnotationAuditInfo>();
|
||||
//foreach (AnnotationAuditInfo aai in AnnotationList)
|
||||
//{
|
||||
// if (aai.IContentID != icontentID)
|
||||
// {
|
||||
// icontentID = aai.IContentID;
|
||||
// if (firstAAI != null)
|
||||
// {
|
||||
// if (lastAAI == null)
|
||||
// {
|
||||
// annotationList.Add(firstAAI);
|
||||
// }
|
||||
// else if (lastAAI.ActionWhat == "Deleted" && firstAAI.DTS < MyProc.DTS)
|
||||
// {
|
||||
// annotationList.Add(lastAAI);
|
||||
// }
|
||||
// else if (lastAAI.ActionWhat == "Changed" && lastAAI.SearchText != firstAAI.SearchText)
|
||||
// {
|
||||
// annotationList.Add(firstAAI);
|
||||
// annotationList.Add(lastAAI);
|
||||
// }
|
||||
// else if (lastAAI.ActionWhat == "Changed" && firstAAI.ActionWhat == "Added" && lastAAI.SearchText == firstAAI.SearchText)
|
||||
// {
|
||||
// annotationList.Add(firstAAI);
|
||||
// }
|
||||
// else if (lastAAI == null && firstAAI.ActionWhat == "Added")
|
||||
// {
|
||||
// annotationList.Add(firstAAI);
|
||||
// }
|
||||
// lastAAI = null;
|
||||
// }
|
||||
// firstAAI = aai;
|
||||
// }
|
||||
// else
|
||||
// lastAAI = aai;
|
||||
//}
|
||||
//if (firstAAI != null)
|
||||
// annotationList.Add(firstAAI);
|
||||
//if (lastAAI != null)
|
||||
// annotationList.Add(lastAAI);
|
||||
AnnotationAuditInfo firstAAI = null;
|
||||
AnnotationAuditInfo nextAAI = null;
|
||||
AnnotationAuditInfo lastAAI = null;
|
||||
int annotationID = 0;
|
||||
List<AnnotationAuditInfo> annotationList = new List<AnnotationAuditInfo>();
|
||||
foreach (AnnotationAuditInfo aai in AnnotationList)
|
||||
{
|
||||
if (aai.AnnotationID != annotationID)
|
||||
{
|
||||
annotationID = aai.AnnotationID;
|
||||
if (firstAAI != null)
|
||||
{
|
||||
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)
|
||||
{
|
||||
annotationList.Add(firstAAI);
|
||||
}
|
||||
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);
|
||||
}
|
||||
lastAAI = null;
|
||||
}
|
||||
firstAAI = aai;
|
||||
}
|
||||
else
|
||||
lastAAI = aai;
|
||||
}
|
||||
if (firstAAI != null)
|
||||
annotationList.Add(firstAAI);
|
||||
if (lastAAI != null)
|
||||
annotationList.Add(lastAAI);
|
||||
#endregion
|
||||
int cols = 5;
|
||||
int borders = 0;
|
||||
@@ -1022,6 +1148,8 @@ namespace Volian.Print.Library
|
||||
t.AddCell(c);
|
||||
t.AddCell(BlankCell(cols));
|
||||
ContentAuditInfo oldCAI = null;
|
||||
string oldText = string.Empty;
|
||||
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)
|
||||
@@ -1030,6 +1158,7 @@ namespace Volian.Print.Library
|
||||
string[] NewPath = SplitPath(cai.Path);
|
||||
if (NewPath[0] != section)
|
||||
{
|
||||
AddStepAnnotation(ref lastAnnotationID, cols, paddingBottom, t, f3, f4, ref h, ref c, oldCAI, processedAAI);
|
||||
section = NewPath[0];
|
||||
h = new Phrase();
|
||||
h.Font = f4;
|
||||
@@ -1045,59 +1174,62 @@ namespace Volian.Print.Library
|
||||
//step
|
||||
if (NewPath[1] != stepnum)
|
||||
{
|
||||
//see if any annotations for old stepnum here and add them
|
||||
foreach (AnnotationAuditInfo aai in AnnotationList)
|
||||
{
|
||||
if (oldCAI != null && aai.IContentID == oldCAI.ContentID)
|
||||
{
|
||||
//add annotation to minilist
|
||||
// processedAAI.Add(aai.AnnotationID, aai);
|
||||
processedAAI.Add(aai, aai);
|
||||
//write row to table
|
||||
t.AddCell(BlankCell(1));
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
h.Add("Annotation " + aai.ActionWhat);
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
c.PaddingBottom = paddingBottom;
|
||||
//c.Border = borders;
|
||||
t.AddCell(c);
|
||||
//who
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
h.Add(aai.UserID);
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
c.PaddingBottom = paddingBottom;
|
||||
//c.Border = borders;
|
||||
t.AddCell(c);
|
||||
//when
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
h.Add(aai.ActionWhen.ToString());
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
c.PaddingBottom = paddingBottom;
|
||||
//c.Border = borders;
|
||||
t.AddCell(c);
|
||||
//new text
|
||||
h = new Phrase();
|
||||
h.Font = f4;
|
||||
//h.Add(cai.Text);
|
||||
h.Add(ItemInfo.ConvertToDisplayText(aai.SearchText));
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = cols - 4;
|
||||
c.HorizontalAlignment = Element.ALIGN_LEFT;
|
||||
c.PaddingBottom = paddingBottom;
|
||||
//c.Border = borders;
|
||||
t.AddCell(c);
|
||||
}
|
||||
}
|
||||
AddStepAnnotation(ref lastAnnotationID, cols, paddingBottom, t, f3, f4, ref h, ref c, oldCAI, processedAAI);
|
||||
////see if any annotations for old stepnum here and add them
|
||||
//foreach (AnnotationAuditInfo aai in annotationList)
|
||||
//{
|
||||
// if (oldCAI != null && aai.IContentID == oldCAI.ContentID)
|
||||
// {
|
||||
// //add annotation to minilist
|
||||
// // processedAAI.Add(aai.AnnotationID, aai);
|
||||
// processedAAI.Add(aai, aai);
|
||||
// //write row to table
|
||||
// t.AddCell(BlankCell(1));
|
||||
// h = new Phrase();
|
||||
// h.Font = f3;
|
||||
// h.Add(AnnotationLookup[aai.TypeID] + " " + aai.ActionWhat);
|
||||
// c = new PdfPCell(h);
|
||||
// c.Colspan = 1;
|
||||
// c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
// c.PaddingBottom = paddingBottom;
|
||||
// //c.Border = borders;
|
||||
// t.AddCell(c);
|
||||
// //who
|
||||
// h = new Phrase();
|
||||
// h.Font = f3;
|
||||
// h.Add(aai.UserID);
|
||||
// c = new PdfPCell(h);
|
||||
// c.Colspan = 1;
|
||||
// c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
// c.PaddingBottom = paddingBottom;
|
||||
// //c.Border = borders;
|
||||
// t.AddCell(c);
|
||||
// //when
|
||||
// h = new Phrase();
|
||||
// h.Font = f3;
|
||||
// h.Add(aai.ActionWhen.ToString());
|
||||
// c = new PdfPCell(h);
|
||||
// c.Colspan = 1;
|
||||
// c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
// c.PaddingBottom = paddingBottom;
|
||||
// //c.Border = borders;
|
||||
// t.AddCell(c);
|
||||
// //new text
|
||||
// h = new Phrase();
|
||||
// h.Font = f4;
|
||||
// //h.Add(cai.Text);
|
||||
// h.Add(ItemInfo.ConvertToDisplayText(aai.SearchText));
|
||||
// c = new PdfPCell(h);
|
||||
// c.Colspan = cols - 4;
|
||||
// c.HorizontalAlignment = Element.ALIGN_LEFT;
|
||||
// c.PaddingBottom = paddingBottom;
|
||||
// //c.Border = borders;
|
||||
// t.AddCell(c);
|
||||
// }
|
||||
//}
|
||||
oldCAI = cai;
|
||||
oldText = cai.Text;
|
||||
oldTypeName = cai.TypeName;
|
||||
firstCAI = cai;
|
||||
stepnum = NewPath[1];
|
||||
string stepnum2 = Regex.Replace(stepnum, "([0-9])[.]([A-Za-z])", "$1 $2");
|
||||
@@ -1122,7 +1254,7 @@ namespace Volian.Print.Library
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
// h.Add(cai.ActionWhen > MyProc.DTS ? cai.ActionWhat : "Original");
|
||||
string actionWhat = (cai.ActionWhat == "Added" && cai.DTS <= MyProc.DTS) ? "Original" : cai.ActionWhat; //(cai.ActionWhat == "Added" && cai.DTS <= MyProc.DTS) ? "Original" : cai.ActionWhat != "Changed" ? cai.ActionWhat : cai.DTS <= maxDTS ? "Restored" : cai.DTS > MyProc.DTS ? cai.ActionWhat : "Original";
|
||||
string actionWhat = ((cai.ActionWhat == "Added" || cai.ActionWhat == "Changed") && cai.DTS <= MyProc.DTS) ? "Original" : cai.ActionWhat; //(cai.ActionWhat == "Added" && cai.DTS <= MyProc.DTS) ? "Original" : cai.ActionWhat != "Changed" ? cai.ActionWhat : cai.DTS <= maxDTS ? "Restored" : cai.DTS > MyProc.DTS ? cai.ActionWhat : "Original";
|
||||
if (actionWhat == "Deleted" || actionWhat == "Restored")
|
||||
h.Add(actionWhat + "\r\n" + cai.ActionWhen.ToString());
|
||||
else
|
||||
@@ -1192,7 +1324,15 @@ namespace Volian.Print.Library
|
||||
{
|
||||
h = new Phrase();
|
||||
h.Font = f4;
|
||||
h.Add(ItemInfo.ConvertToDisplayText(cai.Text));
|
||||
if (cai.Text != oldText && cai.TypeName != oldTypeName)
|
||||
h.Add(string.Format("[Type Change {0} to {1}] - {2}", oldTypeName, cai.TypeName, ItemInfo.ConvertToDisplayText(cai.Text)));// + " to " + cai.TypeName);
|
||||
else if (cai.Text == oldText && cai.TypeName != oldTypeName)
|
||||
h.Add(oldTypeName + " to " + cai.TypeName);
|
||||
else
|
||||
h.Add(ItemInfo.ConvertToDisplayText(cai.Text));
|
||||
oldText = cai.Text;
|
||||
oldTypeName = cai.TypeName;
|
||||
// h.Add(ItemInfo.ConvertToDisplayText(cai.Text) + " " + cai.TypeName);
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = cols - 4;
|
||||
c.HorizontalAlignment = Element.ALIGN_LEFT;
|
||||
@@ -1218,7 +1358,7 @@ namespace Volian.Print.Library
|
||||
//t.AddCell(c);
|
||||
}
|
||||
//see if any annotations for old stepnum here and add them
|
||||
foreach (AnnotationAuditInfo aai in AnnotationList)
|
||||
foreach (AnnotationAuditInfo aai in annotationList)
|
||||
{
|
||||
if (oldCAI != null && aai.IContentID == oldCAI.ContentID)
|
||||
{
|
||||
@@ -1229,7 +1369,7 @@ namespace Volian.Print.Library
|
||||
t.AddCell(BlankCell(1));
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
h.Add("Annotation " + aai.ActionWhat);
|
||||
h.Add(AnnotationLookup[aai.TypeID] + " " + aai.ActionWhat);
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
@@ -1282,7 +1422,7 @@ namespace Volian.Print.Library
|
||||
//t.AddCell(c);
|
||||
//t.AddCell(BlankCell(cols));
|
||||
stepnum = string.Empty;
|
||||
foreach (AnnotationAuditInfo aai in AnnotationList)
|
||||
foreach (AnnotationAuditInfo aai in annotationList)
|
||||
{
|
||||
// if (!processedAAI.ContainsKey(aai.AnnotationID))
|
||||
if (!processedAAI.ContainsKey(aai))
|
||||
@@ -1326,7 +1466,8 @@ namespace Volian.Print.Library
|
||||
//what
|
||||
h = new Phrase();
|
||||
h.Font = f3;
|
||||
h.Add(aai.ActionWhat);
|
||||
|
||||
h.Add(AnnotationLookup[aai.TypeID] + " " + aai.ActionWhat);
|
||||
c = new PdfPCell(h);
|
||||
c.Colspan = 1;
|
||||
c.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||
|
Reference in New Issue
Block a user