From 0f98b74c9af7dd560deed0f5ce1f0ae356f96057 Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 24 Aug 2011 11:49:59 +0000 Subject: [PATCH] --- .../Extension/ROFSTExt.cs | 44 +++++++++++++++---- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs index 183be469..1dd6517e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs @@ -327,7 +327,7 @@ namespace VEPROMS.CSLA.Library } return sb.ToString(); } - private static void UpdateROValuesText(ROFstInfo origROFstInfo, ROFst newROFst) + private static void UpdateROValuesText(ROFstInfo origROFstInfo, ROFst newROFst) { ROFSTLookup origLU = new ROFSTLookup(origROFstInfo); ROFSTLookup newLU = new ROFSTLookup(newROFst); @@ -350,13 +350,17 @@ namespace VEPROMS.CSLA.Library { using (Content content = Content.Get(roUsg.MyContent.ContentID)) { - content.FixContentText(roUsg, roch, origROFstInfo); - if (content.IsDirty) + foreach (ItemInfo ii in roUsg.MyContent.ContentItems) { - // Update UserID and DTS when RO Value is updated. - content.UserID = Volian.Base.Library.VlnSettings.UserID; - content.DTS = DateTime.Now; - content.Save(); + string val = newLU.GetTranslatedRoValue(padroid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); + content.FixContentText(roUsg, val, roch.type, origROFstInfo); + if (content.IsDirty) + { + // Update UserID and DTS when RO Value is updated. + content.UserID = Volian.Base.Library.VlnSettings.UserID; + content.DTS = DateTime.Now; + content.Save(); + } } } } @@ -386,8 +390,30 @@ namespace VEPROMS.CSLA.Library { string desc = string.Format("Deleted RO: Value = {0}", origLU.GetRoValue(del)); string padroiddel = del.Length <= 12 ? del + "0000" : del; - using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroiddel, desc, "Deleted")) ; - using (DROUsageInfoList Daffected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroiddel, desc, "Deleted")) ; + using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroiddel, desc, "Deleted")) + { + foreach (RoUsageInfo roUsg in affected) + { + using (Content content = Content.Get(roUsg.MyContent.ContentID)) + { + content.FixContentText(roUsg, "?", 0, origROFstInfo); + if (content.IsDirty) + { + // Update UserID and DTS when RO Value is updated. + content.UserID = Volian.Base.Library.VlnSettings.UserID; + content.DTS = DateTime.Now; + content.Save(); + } + } + } + } + using (DROUsageInfoList Daffected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, del.Substring(0,12), desc, "Deleted")) + { + foreach (DROUsageInfo droUsg in Daffected) + { + Pdf.DeleteAll(droUsg.DocID); + } + } } } private static List BuildActiveROIDsForRoUsages(string RoidList)