From 2864d8cb27fa657bd65ee8f263a04986776b22c1 Mon Sep 17 00:00:00 2001 From: Jake Date: Thu, 8 Sep 2022 19:50:51 +0000 Subject: [PATCH] B2022-107: Added Optional Parameter "bool isAutomatic = false" to disable the RofstLoadingStatus pop-up screen when printing baselines --- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index a46dc782..8581424a 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -544,8 +544,12 @@ namespace VEPROMS.CSLA.Library } } } - internal static void SetParentSectionAndDocVersion(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo) + + internal static void SetParentSectionAndDocVersion(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, bool isAutomatic = false) { + // B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database + // Added Optional Parameter "bool isAutomatic = false" to disable the RofstLoadingStatus pop-up screen when printing baselines + if (itemInfo == null) return; itemInfo.LoadAllAtOnce = true; itemInfo.ActiveParent = itemParent; @@ -577,7 +581,9 @@ namespace VEPROMS.CSLA.Library //ItemInfo il = null; foreach (ItemInfo ii in pi.MyItems) { - SetParentSectionAndDocVersion(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, procInfo, docVersionInfo); + // B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database + // Added Parameter "isAutomatic" to disable the RofstLoadingStatus pop-up screen when printing baselines + SetParentSectionAndDocVersion(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, procInfo, docVersionInfo, isAutomatic); //if (ii._MyPrevious == null && il!=null) //ii.MyPrevious = il; //if (il != null) il.NextItem = ii; @@ -1057,8 +1063,11 @@ namespace VEPROMS.CSLA.Library return pTab + thisTab.Trim(); } - internal static void SetParentSectionAndDocVersion(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup) + internal static void SetParentSectionAndDocVersion(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup, bool isAutomatic = false) { + // B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database + // Added Optional Parameter "bool isAutomatic = false" to disable the RofstLoadingStatus pop-up screen when printing baselines + if (itemInfo == null) return; itemInfo.LoadAllAtOnce = true; itemInfo.ActiveParent = itemParent; @@ -1089,7 +1098,9 @@ namespace VEPROMS.CSLA.Library otherChildUnit = procnum.Substring(0, idx); // we need to get RO info for the Other child applicability - this gets child's number } - ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo, otherChildUnit); + // B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database + // Added Parameter "isAutomatic" to disable the RofstLoadingStatus pop-up screen when printing baselines + ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo, otherChildUnit, !isAutomatic); lookup.MyItemInfo = itemInfo; // B2022-020 to pass information into error log if needed if (itemInfo.MyContent.ContentGridCount > 0) @@ -1120,7 +1131,9 @@ namespace VEPROMS.CSLA.Library { foreach (ItemInfo ii in pi.MyItems) { - SetParentSectionAndDocVersion(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, docVersionInfo, tranLookup); + // B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database + // Added Parameter "isAutomatic" to disable the RofstLoadingStatus pop-up screen when printing baselines + SetParentSectionAndDocVersion(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, docVersionInfo, tranLookup, isAutomatic); } } } @@ -7349,12 +7362,15 @@ namespace VEPROMS.CSLA.Library throw new DbCslaException("Error on ProcedureInfo:ClearChangeBarOverrides", ex); } } - + //jcb add 20120501 item and children by unit - public static ProcedureInfo GetItemAndChildrenByUnit(int? itemID, int? parentID, int? unitID) + public static ProcedureInfo GetItemAndChildrenByUnit(int? itemID, int? parentID, int? unitID, bool isAutomatic = false) { try { + // B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database + // Added Optional Parameter "bool isAutomatic = false" to disable the RofstLoadingStatus pop-up screen when printing baselines + ProcedureInfo tmp = DataPortal.Fetch(new ItemAndChildrenByUnitCriteria(itemID, parentID, unitID)); AddToCache(tmp); if (tmp.ErrorMessage == "No Record Found") tmp = null; @@ -7368,7 +7384,9 @@ namespace VEPROMS.CSLA.Library //DateTime dt = DateTime.Now; tmp.FromType = E_FromType.Procedure; SetFromType(tmp); - SetParentSectionAndDocVersion(tmp, tmp.MyDocVersion, null, tmp.MyDocVersion, tranLookup); + // B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database + // Added Parameter "isAutomatic" to disable the RofstLoadingStatus pop-up screen when printing baselines + SetParentSectionAndDocVersion(tmp, tmp.MyDocVersion, null, tmp.MyDocVersion, tranLookup, isAutomatic); // B2022-025: dispose cached items after setting transition text that gets done in SetParentSectionAndDocVersion & collect related garbage // B2022-076: comment out dispose. Needed to resolve page number transitions. Note that since B2022-025 was worked, memory improvements have been done for ROs //tranLookup.Dispose(tmp.ItemID); @@ -7607,10 +7625,12 @@ namespace VEPROMS.CSLA.Library { get { return ActiveParent as DocVersionInfo; } } - public static ProcedureInfo GetItemAndChildren(int? itemID) + public static ProcedureInfo GetItemAndChildren(int? itemID, bool isAutomatic = false) { try { + // B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database + // Added Optional Parameter "bool isAutomatic = false" to disable the RofstLoadingStatus pop-up screen when printing baselines ProcedureInfo tmp = DataPortal.Fetch(new ItemAndChildrenCriteria(itemID)); //AddToCache(tmp); if (tmp.ErrorMessage == "No Record Found") tmp = null; @@ -7619,7 +7639,9 @@ namespace VEPROMS.CSLA.Library int profileDepth = ProfileTimer.Push(">>>> SetParentSectionAndDocVersion"); tmp.FromType = E_FromType.Procedure; SetFromType(tmp); - SetParentSectionAndDocVersion(tmp, tmp.MyDocVersion, null, tmp, tmp.MyDocVersion); + // B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database + // Added Parameter "isAutomatic" to disable the RofstLoadingStatus pop-up screen when printing baselines + SetParentSectionAndDocVersion(tmp, tmp.MyDocVersion, null, tmp, tmp.MyDocVersion, isAutomatic); ProfileTimer.Pop(profileDepth); } return tmp;