Resource file for DisplayHistory control

added improvements to All Procedure Inconsistencies Report
This commit is contained in:
Rich
2012-01-26 19:47:07 +00:00
parent 1709f8970d
commit b4c4b0ef55
2 changed files with 217 additions and 21 deletions

View File

@@ -288,7 +288,8 @@ namespace Volian.Print.Library
}
else
{
Dictionary<string, List<string>> ros = new Dictionary<string, List<string>>();
// Dictionary<string, List<string>> ros = new Dictionary<string, List<string>>();
Dictionary<string, Dictionary<string, bool>> ros = new Dictionary<string, Dictionary<string, bool>>();
ROFSTLookup lu = MyItemInfoList[0].MyDocVersion.DocVersionAssociations[0].MyROFst.ROFSTLookup;
if (types.ContainsKey(0))
{
@@ -299,22 +300,24 @@ namespace Volian.Print.Library
ROFSTLookup.rochild rocc = lu.GetRoChild12(roc.ROID);
if (rocc.type == 1)
{
string rotitle = string.Format("{0} - {1}", lu.GetROTitle(roc.ROID), lu.GetRoValue(roc.ROID).Replace('`','\xb0'));
string newROValue = lu.GetRoValue(roc.ROID).Replace('`', '\xb0');
string rotitle = string.Format("{0} - Current Version: {1}", lu.GetROTitle(roc.ROID), lu.GetRoValue(roc.ROID).Replace('`','\xb0'));
if (ros.ContainsKey(rotitle))
{
ros[rotitle].Add(string.Format("Procedure {0} has an ROValue of: {1}", pi.DisplayNumber, roc.ROValue));
ros[rotitle].Add(string.Format("Procedure {0} has an ROValue of: {1}", pi.DisplayNumber, roc.ROValue),roc.ROValue == newROValue);
}
else
{
ros.Add(rotitle, new List<string>());
ros[rotitle].Add(string.Format("Procedure {0} has an ROValue of: {1}", pi.DisplayNumber, roc.ROValue));
ros.Add(rotitle, new Dictionary<string,bool>());
ros[rotitle].Add(string.Format("Procedure {0} has an ROValue of: {1}", pi.DisplayNumber, roc.ROValue),roc.ROValue == newROValue);
}
}
}
}
}
//jcb
Dictionary<string, List<string>> trs = new Dictionary<string, List<string>>();
Dictionary<string, Dictionary<string, bool>> trs = new Dictionary<string, Dictionary<string, bool>>();
//Dictionary<string, List<string>> trs = new Dictionary<string, List<string>>();
if (types.ContainsKey(1))
{
foreach (ProcedureInfo pi in MyItemInfoList)
@@ -322,21 +325,29 @@ namespace Volian.Print.Library
foreach (TransitionCheck trc in pi.MyDifferences.TransitionConsistency.MyTransitionChecks)
{
TransitionInfo ti = TransitionInfo.Get(trc.TransitionID);
string trtitle = "From Procedure " + ti.MyContent.ContentItems[0].Path;
string fromText = ti.MyContent.Text;
//GO TO \\v <START]\\v0 0POP05\\u8209?EO\\u8209?EO10, LOSS OF REACTOR OR SECONDARY COOLANT, Step 21\\v #Link:Transition:0 1182 1864[END>\\v0
MatchCollection mc = Regex.Matches(fromText, @"\<START.*? (.*?)\\v #Link:Transition:[0-9]+ ([0-9]+) .*?\[END\>");
foreach (Match m in mc)
if (m.Groups[2].Value == ti.TransitionID.ToString())
fromText = ItemInfo.ConvertToDisplayText(m.Groups[1].Value);
string newValue = ti.MyContent.ContentItems[0].Path + "\r\nCurrent Version: " + fromText;
string trtitle = "From Procedure " + newValue;
if (trs.ContainsKey(trtitle))
{
trs[trtitle].Add(string.Format("According to {0} the destination is: {1}", pi.DisplayNumber, ItemInfo.ConvertToDisplayText(trc.TransitionValue)));
trs[trtitle].Add(string.Format("According to {0} the destination is: {1}", pi.DisplayNumber, ItemInfo.ConvertToDisplayText(trc.TransitionValue)), ItemInfo.ConvertToDisplayText(trc.TransitionValue) == fromText);
}
else
{
trs.Add(trtitle, new List<string>());
trs[trtitle].Add(string.Format("According to {0} the destination is: {1}", pi.DisplayNumber, ItemInfo.ConvertToDisplayText(trc.TransitionValue)));
trs.Add(trtitle, new Dictionary<string,bool>());
trs[trtitle].Add(string.Format("According to {0} the destination is: {1}", pi.DisplayNumber, ItemInfo.ConvertToDisplayText(trc.TransitionValue)), ItemInfo.ConvertToDisplayText(trc.TransitionValue) == fromText);
}
}
}
}
//end jcb
Dictionary<string, List<string>> lds = new Dictionary<string, List<string>>();
Dictionary<string, Dictionary<string, bool>> lds = new Dictionary<string, Dictionary<string, bool>>();
//Dictionary<string, List<string>> lds = new Dictionary<string, List<string>>();
if (types.ContainsKey(2))
{
foreach (ProcedureInfo pi in MyItemInfoList)
@@ -344,19 +355,22 @@ namespace Volian.Print.Library
foreach (LibDocCheck ldc in pi.MyDifferences.LibDocConsistency.MyLibDocChecks)
{
DocumentInfo di = DocumentInfo.Get(ldc.DocID);
string ldtitle = string.Format("{0} - {1}", di.DocumentTitle, di.DTS.ToString());
string newValue = di.DTS.ToString();
string ldtitle = string.Format("{0} - Current Version: {1}", di.DocumentTitle, di.DTS.ToString());
if (lds.ContainsKey(ldtitle))
{
lds[ldtitle].Add(string.Format("Procedure {0} has a Document Date of: {1}", pi.DisplayNumber, ldc.DocDate.ToString()));
lds[ldtitle].Add(string.Format("Procedure {0} has a Document Date of: {1}", pi.DisplayNumber, ldc.DocDate.ToString()),ldc.DocDate.ToString() == newValue);
}
else
{
lds.Add(ldtitle, new List<string>());
lds[ldtitle].Add(string.Format("Procedure {0} has a Document Date of: {1}", pi.DisplayNumber, ldc.DocDate.ToString()));
lds.Add(ldtitle, new Dictionary<string,bool>());
lds[ldtitle].Add(string.Format("Procedure {0} has a Document Date of: {1}", pi.DisplayNumber, ldc.DocDate.ToString()), ldc.DocDate.ToString() == newValue);
}
}
}
}
Color goodColor = new Color(System.Drawing.Color.PaleGreen);
Color badColor = new Color(System.Drawing.Color.Khaki);
if (types.ContainsKey(0))
{
h = new Phrase();
@@ -373,14 +387,19 @@ namespace Volian.Print.Library
h.Add(rotitle);
c = new PdfPCell(h);
c.Colspan = cols - 1;
c.BackgroundColor = goodColor;
t.AddCell(c);
foreach (string s in ros[rotitle])
foreach (KeyValuePair<string,bool> d in ros[rotitle])
{
t.AddCell(BlankCell(2));
h = new Phrase();
h.Font = f3;
h.Add(s);
h.Add(d.Key);
c = new PdfPCell(h);
if (d.Value)
c.BackgroundColor = goodColor;
else
c.BackgroundColor = badColor;
t.AddCell(c);
}
}
@@ -402,14 +421,19 @@ namespace Volian.Print.Library
h.Add(trtitle);
c = new PdfPCell(h);
c.Colspan = cols - 1;
c.BackgroundColor = goodColor;
t.AddCell(c);
foreach (string s in trs[trtitle])
foreach (KeyValuePair<string, bool> d in trs[trtitle])
{
t.AddCell(BlankCell(2));
h = new Phrase();
h.Font = f3;
h.Add(s);
h.Add(d.Key);
c = new PdfPCell(h);
if (d.Value)
c.BackgroundColor = goodColor;
else
c.BackgroundColor = badColor;
t.AddCell(c);
}
}
@@ -431,14 +455,19 @@ namespace Volian.Print.Library
h.Add(ldtitle);
c = new PdfPCell(h);
c.Colspan = cols - 1;
c.BackgroundColor = goodColor;
t.AddCell(c);
foreach (string s in lds[ldtitle])
foreach (KeyValuePair<string, bool> d in lds[ldtitle])
{
t.AddCell(BlankCell(2));
h = new Phrase();
h.Font = f3;
h.Add(s);
h.Add(d.Key);
c = new PdfPCell(h);
if (d.Value)
c.BackgroundColor = goodColor;
else
c.BackgroundColor = badColor;
t.AddCell(c);
}
}