From c5bed5fe5a0c59fbc74188f9e3f9f798f471ab99 Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 20 Jun 2014 14:07:05 +0000 Subject: [PATCH] Updated ItemInfo "HasChangeBar" property to use the Change ID format flag and the Change ID status to limit when a change bar is displayed. Created a new property "HasChanges" which determines if the date time stamp of the current text element is newer than the procedures last approval date. --- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 4fbe1a06..b0bd263b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2245,6 +2245,24 @@ namespace VEPROMS.CSLA.Library #endregion #region Change Bar public bool HasChangeBar + { + get + { + bool chg = HasChanges; + StepInfo si = this as StepInfo; + if (si == null) return false; + StepConfig sc = si.MyConfig as StepConfig; + if (sc == null) return false; + // if there is no override & return whether there was a change to the text. + if (chg && ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds && + (sc.Step_ChangeID ?? "") == "") + return false; // No Change ID - No Change Bar + if (sc.Step_CBOverride == null) + return chg; + return (sc.Step_CBOverride == "On"); + } + } + public bool HasChanges { get { @@ -2254,10 +2272,7 @@ namespace VEPROMS.CSLA.Library StepConfig sc = si.MyConfig as StepConfig; if (sc == null) return false; // if there is no override & return whether there was a change to the text. - if (sc.Step_CBOverride == null) - return (MyContent.DTS > MyProcedure.ChangeBarDate); - else // override is on: - return (sc.Step_CBOverride == "On"); + return (MyContent.DTS > MyProcedure.ChangeBarDate); } } #endregion