Added call to SetRevDate in MyProcedureInfo property of DisplayHistory class
Added method SetRevDate to DisplayHistory class Added ApplDisplayMode property to DisplayHistory class Removed blank line Comment out setting selected tab Managed property ApplDisplayMode on lbChanges visibility changed event handler Added call to Application.DoEvents in WalkProcedure method of DisplayHistory class to refresh screen changed how ContentAuditInfoList and AnnotationAuditInfoList are populated in WalkProcedure method of DisplayHistory class Line Removed, no longer needed Changes how ContentAuditInfoList items are handled Changes how AnnotationAuditInfoList items are handled Utilizes ApplyDisplayMode value when preparing Chronology report Utilizes ApplyDisplayMode value when preparing Summary report Changed order of how code works Preset tabControl1 selected tabindex to 2 Changed parameter value passed to DisplayTabItem method of DisplayTabControl class Assigns myItemInfo variable to passed parameter
This commit is contained in:
parent
c63d792953
commit
3ca571fab4
@ -56,10 +56,16 @@ namespace Volian.Controls.Library
|
||||
return;
|
||||
_MyProcedureInfo = value;
|
||||
if (value == null) return;
|
||||
SetRevDate(MyProcedureInfo.DTS);
|
||||
if (_MyProcedureInfo != null && this.Visible)
|
||||
WalkProcedure();
|
||||
}
|
||||
}
|
||||
private void SetRevDate(DateTime dts)
|
||||
{
|
||||
MyRevDate = dts;
|
||||
RefreshRequired = true;
|
||||
}
|
||||
private ItemInfo _MyItemInfo;
|
||||
public ItemInfo MyItemInfo
|
||||
{
|
||||
@ -108,18 +114,65 @@ namespace Volian.Controls.Library
|
||||
UpdateHistory();
|
||||
}
|
||||
}
|
||||
private int _ApplDisplayMode = -1;
|
||||
public int ApplDisplayMode
|
||||
{
|
||||
get { return _ApplDisplayMode; }
|
||||
set
|
||||
{
|
||||
if (MyProcedureInfo == null) return;
|
||||
_ApplDisplayMode = value;
|
||||
RefreshRequired = true;
|
||||
if (_ApplDisplayMode > 0)
|
||||
{
|
||||
MyProcedureInfo.MyProcedure.MyContent.RefreshContentDetails();
|
||||
ProcedureConfig cfg = MyProcedureInfo.MyConfig as ProcedureConfig;
|
||||
cfg.SelectedSlave = value;
|
||||
if (cfg.Print_RevDate == null || cfg.Print_RevDate == string.Empty)
|
||||
SetRevDate(MyProcedureInfo.DTS);
|
||||
else
|
||||
SetRevDate(DateTime.Parse(cfg.Print_RevDate));
|
||||
}
|
||||
else
|
||||
{
|
||||
DateTime minDts = DateTime.MaxValue;
|
||||
for (int j = 1; j <= MyProcedureInfo.MyDocVersion.DocVersionConfig.Unit_Count; j++)
|
||||
{
|
||||
ProcedureConfig cfg = MyProcedureInfo.MyConfig as ProcedureConfig;
|
||||
cfg.SelectedSlave = j;
|
||||
if (cfg.Print_RevDate != null && cfg.Print_RevDate != string.Empty)
|
||||
{
|
||||
if (DateTime.Parse(cfg.Print_RevDate) < minDts && DateTime.Parse(cfg.Print_RevDate) > MyProcedureInfo.DTS)
|
||||
minDts = DateTime.Parse(cfg.Print_RevDate);
|
||||
}
|
||||
else
|
||||
minDts = MyProcedureInfo.DTS;
|
||||
}
|
||||
SetRevDate(minDts);
|
||||
}
|
||||
}
|
||||
}
|
||||
private DateTime _MyRevDate;
|
||||
public DateTime MyRevDate
|
||||
{
|
||||
get { return _MyRevDate; }
|
||||
set { _MyRevDate = value; }
|
||||
}
|
||||
private bool RefreshRequired = false;
|
||||
|
||||
public DisplayHistory()
|
||||
{
|
||||
InitializeComponent();
|
||||
myRTB.FormatFont = null;
|
||||
RefreshRequired = true;
|
||||
//tabControl1.SelectedTab = tabItem1;// Start with Change List
|
||||
//tabControl1.SelectedTab = tabItem2;// Start with Change List
|
||||
}
|
||||
|
||||
private void lbChanges_VisibleChanged(object sender, System.EventArgs e)
|
||||
{
|
||||
if (ApplDisplayMode == -1)
|
||||
{
|
||||
ApplDisplayMode = 0;
|
||||
}
|
||||
if (RefreshRequired)
|
||||
{
|
||||
Console.WriteLine("before walkprocedure - {0}", DateTime.Now.ToLongTimeString());
|
||||
@ -418,6 +471,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
//return;
|
||||
this.ParentForm.Cursor = Cursors.WaitCursor;
|
||||
Application.DoEvents();
|
||||
//DateTime start = DateTime.Now;
|
||||
//Console.WriteLine(start);
|
||||
lbChanges.Items.Clear();
|
||||
@ -427,17 +481,29 @@ namespace Volian.Controls.Library
|
||||
btnViewSummaryReport.Enabled = btnViewChronologyReport.Enabled = lbChanges.Items.Count > 0;
|
||||
return;
|
||||
}
|
||||
ContentAuditInfoList cail2 = ContentAuditInfoList.GetChronology(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false);
|
||||
ContentAuditInfoList cail2;
|
||||
ContentAuditInfoList cail3;
|
||||
AnnotationAuditInfoList aail2;
|
||||
if (ApplDisplayMode > 0)
|
||||
{
|
||||
cail2 = ContentAuditInfoList.GetChronologyByUnit(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false, ApplDisplayMode);
|
||||
cail3 = ContentAuditInfoList.GetSummaryByUnit(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false, ApplDisplayMode);
|
||||
aail2 = AnnotationAuditInfoList.GetChronologyByUnit(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, ApplDisplayMode);
|
||||
}
|
||||
else
|
||||
{
|
||||
cail2 = ContentAuditInfoList.GetChronology(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false);
|
||||
cail3 = ContentAuditInfoList.GetSummary(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false);
|
||||
aail2 = AnnotationAuditInfoList.GetChronology(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID);
|
||||
}
|
||||
//Console.WriteLine("WalkProcedure cail2: {0} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds);
|
||||
_ChronologyAuditList = cail2;
|
||||
ContentAuditInfoList cail3 = ContentAuditInfoList.GetSummary(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false);
|
||||
_SummaryAuditList = cail3;
|
||||
AnnotationAuditInfoList aail2 = AnnotationAuditInfoList.GetChronology(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID);
|
||||
//Console.WriteLine("WalkProcedure aail2: {0} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds);
|
||||
_AnnotationList = aail2;
|
||||
foreach (ContentAuditInfo cai in cail2)
|
||||
{
|
||||
if (cai.DTS > MyProcedureInfo.DTS || cai.ActionWhen > MyProcedureInfo.DTS)
|
||||
if (cai.DTS > MyRevDate || cai.ActionWhen > MyRevDate)
|
||||
{
|
||||
string itemTitle = FixPath(cai.Path);
|
||||
lbChanges.Items.Add(cai);
|
||||
@ -460,7 +526,7 @@ namespace Volian.Controls.Library
|
||||
if(iii != null)
|
||||
stepnum = FixPath(iii.SearchPath);
|
||||
}
|
||||
if(aai.DTS > MyProcedureInfo.DTS)
|
||||
if (aai.DTS > MyRevDate)
|
||||
lbChanges.Items.Add(aai);
|
||||
}
|
||||
//Console.WriteLine("WalkProcedure fini: {0} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds);
|
||||
@ -482,7 +548,9 @@ namespace Volian.Controls.Library
|
||||
//{
|
||||
//jcb added 20120425 to suppress annotations in report
|
||||
_AnnotationList = AnnotationAuditInfoList.GetChronology(0, 0);
|
||||
OnChronologyPrintRequest(new DisplayHistoryReportEventArgs(Volian.Base.Library.VlnSettings.TemporaryFolder + @"\MyChronology.pdf", MyItemInfo.MyProcedure, _ChronologyAuditList, _AnnotationList));
|
||||
//added setting selected slave in order for reports to replace unit number,etc jcb 20101010
|
||||
MyItemInfo.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = ApplDisplayMode;
|
||||
OnChronologyPrintRequest(new DisplayHistoryReportEventArgs(Volian.Base.Library.VlnSettings.TemporaryFolder + @"\MyChronology.pdf", MyItemInfo.MyProcedure, _ChronologyAuditList, _AnnotationList));
|
||||
//}
|
||||
}
|
||||
private void btnViewSummaryReport_Click(object sender, EventArgs e)
|
||||
@ -492,6 +560,8 @@ namespace Volian.Controls.Library
|
||||
//{
|
||||
//jcb added 20120425 to suppress annotations in report
|
||||
_AnnotationList = AnnotationAuditInfoList.GetChronology(0, 0);
|
||||
//added setting selected slave in order for reports to replace unit number,etc jcb 20101010
|
||||
MyItemInfo.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = ApplDisplayMode;
|
||||
OnSummaryPrintRequest(new DisplayHistoryReportEventArgs(Volian.Base.Library.VlnSettings.TemporaryFolder + @"\MySummary.pdf", MyItemInfo.MyProcedure, _SummaryAuditList, _AnnotationList));
|
||||
//}
|
||||
}
|
||||
@ -631,8 +701,8 @@ namespace Volian.Controls.Library
|
||||
if (MessageBox.Show(this, "Do you want to restore this annotation?", "Confirm Annotation Restore", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
AnnotationInfo ai = AnnotationInfo.RestoreAnnotation(aai);
|
||||
RefreshRequired = true;
|
||||
OnAnnotationRestored(ai, ai.MyItem);
|
||||
RefreshRequired = true;
|
||||
UpdateHistory();
|
||||
myRTB.Clear();
|
||||
myVFG.Clear();
|
||||
|
BIN
PROMS/Volian.Controls.Library/DisplayHistory.designer.cs
generated
BIN
PROMS/Volian.Controls.Library/DisplayHistory.designer.cs
generated
Binary file not shown.
@ -321,8 +321,16 @@ namespace Volian.Controls.Library
|
||||
/// </summary>
|
||||
/// <param name="myItemInfo"></param>
|
||||
/// <returns></returns>
|
||||
public DisplayTabItem OpenItem(ItemInfo myItemInfo)
|
||||
public DisplayTabItem OpenItem(ItemInfo myItemInfo2)
|
||||
{
|
||||
ItemInfo myItemInfo = myItemInfo2;
|
||||
//if (myItemInfo.IsProcedure)
|
||||
//{
|
||||
// DateTime start = DateTime.Now;
|
||||
// myItemInfo = ProcedureInfo.GetItemAndChildrenByUnit(myItemInfo.ItemID, 0, 2);
|
||||
// TimeSpan howlong = DateTime.Now - start;
|
||||
// Console.WriteLine("Overall - " + howlong.ToString());
|
||||
//}
|
||||
CleanUpClosedItems();
|
||||
if (myItemInfo == null) return null;
|
||||
// if this is an auto table of contents section, don't edit it:
|
||||
|
Loading…
x
Reference in New Issue
Block a user