Modified to use newly created ProcedureInfo property PDFNumber

Modified to standardize naming of summary of changes report
Added method to delete existing pdf when creating a new pdf of same name
Created error handler to warn user when trying to view pdf file already open
Created new ProcedureInfo property PDFNumber to handle slashes in procedure number
Corrected error in ResolvePathTo method of TranistionInfo class
This commit is contained in:
Rich
2013-04-10 14:21:07 +00:00
parent a7c689f23a
commit ca6c80487c
5 changed files with 107 additions and 18 deletions

View File

@@ -418,6 +418,21 @@ namespace VEPROMS.CSLA.Library
foreach (ItemInfo ii in pi.MyItems)
SetParentSectionAndDocVersion(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, procInfo, docVersionInfo);
}
//internal static long ticksROUsage;
//internal static long ticksItems;
//internal static long ticksTrans;
//internal static void ResetTicks()
//{
// ticksROUsage = 0;
// ticksItems = 0;
// ticksTrans = 0;
//}
//internal static void ShowTicks()
//{
// Console.WriteLine("ROUsage: {0}", TimeSpan.FromTicks(ticksROUsage).TotalSeconds);
// Console.WriteLine("Items: {0}", TimeSpan.FromTicks(ticksItems).TotalSeconds);
// Console.WriteLine("Transitions: {0}", TimeSpan.FromTicks(ticksTrans).TotalSeconds);
//}
internal static void SetParentSectionAndDocVersion(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
{
if (itemInfo == null) return;
@@ -429,6 +444,7 @@ namespace VEPROMS.CSLA.Library
rofstinfo.docVer = docVersionInfo;
ROFSTLookup lookup = rofstinfo.ROFSTLookup;
lookup.DocVersionInfo = docVersionInfo;
//DateTime dts = DateTime.Now;
if (itemInfo.MyContent.ContentRoUsageCount > 0)
{
foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages)
@@ -441,17 +457,22 @@ namespace VEPROMS.CSLA.Library
}
}
}
//TimeSpan ts = DateTime.Now.Subtract(dts);
//ticksROUsage += ts.Ticks;
//dts = DateTime.Now;
if (itemInfo.MyContent.ContentPartCount > 0)
{
foreach (PartInfo pi in itemInfo.MyContent.ContentParts)
{
foreach (ItemInfo ii in pi.MyItems)
{
Console.WriteLine(ii.ItemID.ToString());
SetParentSectionAndDocVersion(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, docVersionInfo, tranLookup);
}
}
}
//ts = DateTime.Now.Subtract(dts);
//ticksItems += ts.Ticks;
//dts = DateTime.Now;
if (itemInfo.MyContent.ContentTransitionCount > 0)
{
//itemInfo.UpdateTransitionText();
@@ -461,6 +482,8 @@ namespace VEPROMS.CSLA.Library
itemInfo.MyContent.FixTransitionText(traninfo, tranLookup);
}
}
//ts = DateTime.Now.Subtract(dts);
//ticksTrans += ts.Ticks;
}
private int _PrintBias = 0;
public int PrintBias
@@ -4054,8 +4077,11 @@ namespace VEPROMS.CSLA.Library
}
public void AddProcLookup(int procID, Dictionary<int, ItemInfo> mylookup)
{
if(!_MyLookups.ContainsKey(procID))
if (!_MyLookups.ContainsKey(procID))
{
_MyLookups.Add(procID, mylookup);
//Console.WriteLine("AddProcLookup: {0}", procID);
}
}
public ItemInfo this[int itemID]
{
@@ -4084,6 +4110,14 @@ namespace VEPROMS.CSLA.Library
[Serializable()]
public partial class ProcedureInfo : ItemInfo, IVEDrillDownReadOnly
{
public string PDFNumber
{
get
{
string slashReplace = this.ActiveFormat.PlantFormat.FormatData.PrintData.SlashReplace ?? "_";
return DisplayNumber.Replace("/", slashReplace).Replace("\\", slashReplace).Replace("*","Master");
}
}
private DateTime? _ChangeBarDate = null;
public DateTime ChangeBarDate
{
@@ -4172,7 +4206,12 @@ namespace VEPROMS.CSLA.Library
(tmp.MyConfig as ProcedureConfig).SelectedSlave = (int)unitID;
TransitionLookup tranLookup = new TransitionLookup((int)unitID, (int)itemID, tmp.MyLookup);
tranLookup.NewLookupNeeded += new TransitionLookupEvent(GetNewLookup);
//ItemInfo.ResetTicks();
//DateTime dt = DateTime.Now;
SetParentSectionAndDocVersion(tmp, tmp.MyDocVersion, null, tmp.MyDocVersion, tranLookup);
//TimeSpan ts = DateTime.Now.Subtract(dt);
//ticksItems = ts.Ticks - (ticksROUsage + ticksTrans);
//ItemInfo.ShowTicks();
}
return tmp;
}
@@ -4246,6 +4285,8 @@ namespace VEPROMS.CSLA.Library
}
else
{
//if (dr.GetInt32("ItemID") == 336)
// Console.WriteLine("here");
ItemInfo itemInfo = null;
int itemType = dr.GetInt32("Type") / 10000;
switch (itemType)

View File

@@ -57,10 +57,12 @@ namespace VEPROMS.CSLA.Library
{
//different proc
//_MyLog.WarnFormat("Transition May Not Be Correct at Location From {0} To {1}", item.SearchPath, myItemToID.SearchPath);
tranLookup.AddProcLookup(myItemToID.MyProcedure.ItemID, ProcedureInfo.GetNewLookup(tranLookup, new TransitionLookupEventArgs(ToID, tranLookup.ApplicabilityUnit, MyItemToID.MyDocVersion, tranLookup)).MyLookup);
if(!tranLookup.MyLookups.ContainsKey(myItemToID.MyProcedure.ItemID))
tranLookup.AddProcLookup(myItemToID.MyProcedure.ItemID, ProcedureInfo.GetNewLookup(tranLookup, new TransitionLookupEventArgs(myItemToID.MyProcedure.ItemID, tranLookup.ApplicabilityUnit, MyItemToID.MyDocVersion, tranLookup)).MyLookup);
if (tranLookup.ContainsKey(ToID))
myItemToID = tranLookup[ToID];
//Console.WriteLine("Transition May Not Be Correct at Location");
//else
// Console.WriteLine("Transition May Not Be Correct at Location");
}
ItemInfo myItemRangeID = MyItemRangeID;
if (tranLookup.ContainsKey(RangeID))
@@ -69,10 +71,12 @@ namespace VEPROMS.CSLA.Library
{
//different proc
//_MyLog.WarnFormat("Transition May Not Be Correct at Location From {0} To {1}", item.SearchPath, myItemRangeID.SearchPath);
tranLookup.AddProcLookup(MyItemRangeID.MyProcedure.ItemID, ProcedureInfo.GetNewLookup(tranLookup, new TransitionLookupEventArgs(RangeID, tranLookup.ApplicabilityUnit,MyItemRangeID.MyDocVersion, tranLookup)).MyLookup);
if (!tranLookup.MyLookups.ContainsKey(MyItemRangeID.MyProcedure.ItemID))
tranLookup.AddProcLookup(MyItemRangeID.MyProcedure.ItemID, ProcedureInfo.GetNewLookup(tranLookup, new TransitionLookupEventArgs(MyItemRangeID.MyProcedure.ItemID, tranLookup.ApplicabilityUnit, MyItemRangeID.MyDocVersion, tranLookup)).MyLookup);
if (tranLookup.ContainsKey(RangeID))
myItemRangeID = tranLookup[RangeID];
//Console.WriteLine("Transition May Not Be Correct at Location");
//else
// Console.WriteLine("Transition May Not Be Correct at Location");
//Console.WriteLine("Format = {0}", item.ActiveFormat);
//Console.WriteLine("item = {0}", item.ItemID);
//Console.WriteLine("TranType = {0}", TranType);