B2022-088: Find Doc Ro button not working in Word Sections

B2022-089: Updating RO Crashes
This commit is contained in:
Jake
2022-08-08 10:04:21 +00:00
parent b6d69fbd4c
commit f8269a7ac6
13 changed files with 271 additions and 125 deletions

View File

@@ -1617,7 +1617,9 @@ namespace VEPROMS.CSLA.Library
{
RoUsageInfo rou = RoUsageInfo.Get(ro.ROUsageID);
string myvalue = mylookup.GetTranslatedRoValue(rou.ROID, tmp.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, tmp.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues);
ROFSTLookup.rochild rocc = mylookup.GetRoChild(rou.ROID);
int mytype = rocc.type;
cont.FixContentText(rou, myvalue, mytype, myRoFst);
}

View File

@@ -783,7 +783,8 @@ namespace VEPROMS.CSLA.Library
// 5) If a specific RoChild return value does not exist (maybe it was removed in the ROEditor / latest RO.FST file), then just return
// the first RoChild return value in the "children" collection (0041) instead
private static Dictionary<string, ROFSTLookup.rochild> _roPrintCache = new Dictionary<string, ROFSTLookup.rochild>();
// B2022-088: Find Doc Ro button not working in Word Sections
public static Dictionary<string, ROFSTLookup.rochild> RoPrintCache = new Dictionary<string, ROFSTLookup.rochild>();
#endregion
@@ -1154,9 +1155,6 @@ namespace VEPROMS.CSLA.Library
int lastStart = sel == null ? 0 : sel.Start;
// Cache RO Values while printing for performance increase
_roPrintCache = new Dictionary<string, ROFSTLookup.rochild>();
while (sel != null)
{
if (!string.IsNullOrEmpty(sel.Text))
@@ -1335,10 +1333,6 @@ namespace VEPROMS.CSLA.Library
}
}
// Disable/Clear RO Cache When done looking up RO Values during printing
_roPrintCache.Clear();
_roPrintCache = null;
if (statusChange != null) statusChange(VolianStatusType.Update, 0, "Creating PDF");
sel = MyApp.Selection;
sel.WholeStory();
@@ -1398,7 +1392,7 @@ namespace VEPROMS.CSLA.Library
string accPageKey = ROFSTLookup.FormatAccPageKey(selText, spPrefix, igPrefix, ref accPageBase, ref accPageExt, true);
// Check if the Rochild is in the PrintCache (use base accPageID without specific extension)
if (!_roPrintCache.ContainsKey(accPageBase))
if (!RoPrintCache.ContainsKey(accPageBase))
{
// Lookup RoChild Info from database
roc = lookup.GetROChildByAccPageID(accPageBase, spPrefix, igPrefix);
@@ -1408,11 +1402,11 @@ namespace VEPROMS.CSLA.Library
return ROFSTLookup.GetEmptyRoChild();
// If Valid Rochild, then add Rochild to Print Cache
_roPrintCache.Add(accPageBase, roc);
RoPrintCache.Add(accPageBase, roc);
}
else // Get Base Rochild from Print Cache
{
roc = (ROFSTLookup.rochild)_roPrintCache[accPageBase];
roc = (ROFSTLookup.rochild)RoPrintCache[accPageBase];
}
// Check if RO is a "Unit Information" value (Ex: <U-ID>, etc..)

View File

@@ -664,10 +664,12 @@ namespace VEPROMS.CSLA.Library
if (activeRoids.Contains(chg.Substring(0, 12)))
{
ROFSTLookup.rochild roch = newLookup.GetRoChild(chg);
string desc = string.Format("Change in RO Values: Old value = {0}, New value = {1}", origLookup.GetRoValue(chg), roch.value);
string desc = string.Format("Change in RO Values: Old value = {0}, New value = {1}", origLookup.GetRoChild(chg).value, roch.value);
// roid's are stored in database as 16 characters long in the RoUsages table. They may be stored as 12 characters in the ro.fst.
string padroid = chg.Length <= 12 ? chg + "0000" : chg;
// string padroid = chg.Length <= 12 ? chg + "0000" : chg;
// B2022-088: Find Doc Ro button not working in Word Sections
string padroid = ROFSTLookup.FormatRoidKey(chg, true);
using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid, desc, "Changed", versionList))
{
@@ -708,14 +710,17 @@ namespace VEPROMS.CSLA.Library
{
foreach (string chg in chgList)
{
string padroid = chg.Length <= 12 ? chg + "0000" : chg;
// B2022-088: Find Doc Ro button not working in Word Sections
// string padroid = chg.Length <= 12 ? chg + "0000" : chg;
string padroid = ROFSTLookup.FormatRoidKey(chg, true);
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Updating RO Values");
if (activeDRoids.Contains(chg.Substring(0, 12)))
{
ROFSTLookup.rochild roch = newLookup.GetRoChild(chg);
string desc = string.Format("Change in RO Values: Old value = {0}, New value = {1}", origLookup.GetRoValue(chg), roch.value);
string desc = string.Format("Change in RO Values: Old value = {0}, New value = {1}", origLookup.GetRoChild(chg).value, roch.value);
// roid's are stored in database as 16 characters long in the rousages table. They may be stored as 12 characters in the ro.fst.
using (DROUsageInfoList affected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid, desc, "Changed", versionList))
@@ -738,9 +743,12 @@ namespace VEPROMS.CSLA.Library
{
foreach (string del in delList)
{
string padroiddel = del.Length <= 12 ? del + "0000" : del;
// B2022-088: Find Doc Ro button not working in Word Sections
//string padroiddel = del.Length <= 12 ? del + "0000" : del;
string padroiddel = ROFSTLookup.FormatRoidKey(del, true);
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values");
string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoValue(del));
string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoChild(del).value);
if (activeRoids.Contains(del.Substring(0, 12).ToUpper()))
{
@@ -773,8 +781,15 @@ namespace VEPROMS.CSLA.Library
{
foreach (string del in delList)
{
string padroiddel = del.Length <= 12 ? del + "0000" : del;
string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoValue(del));
// B2022-088: Find Doc Ro button not working in Word Sections
string padroiddel = ROFSTLookup.FormatRoidKey(del, true);
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values");
string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoChild(del).value);
// If there's an issue then maybe try getting the RoChild with the Padded roid instead
//string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoChild(padroiddel).value);
if (activeDRoids.Contains(del.Substring(0, 12).ToUpper()))
{

View File

@@ -930,6 +930,7 @@ namespace VEPROMS.CSLA.Library
foreach (DROUsageInfo myRO in myList)
if (!myROIDs.Contains(myRO.ROID.ToUpper()))
myROIDs.Add(myRO.ROID.ToUpper());
//create checkro record for each roid
//_MyTimer.ActiveProcess = "Get DocVersionInfo";
// DocVersionInfo dbi = proc.ActiveParent as DocVersionInfo;
@@ -942,8 +943,13 @@ namespace VEPROMS.CSLA.Library
ROFSTLookup lookup = rofst.GetROFSTLookup(dvi);
//_MyTimer.ActiveProcess = "Populating RevisionChecksXML table";
cc.ROConsistency.ROFstDate = rofst.DTS;
foreach (string s in myROIDs)
cc.AddROCheck(s, ItemInfo.ConvertToDisplayText(lookup.GetRoValue(s)));
{
// B2022-088: Find Doc Ro button not working in Word Sections
cc.AddROCheck(s, ItemInfo.ConvertToDisplayText(((ROFSTLookup.rochild)lookup.GetRoChild(s)).value));
}
//_MyTimer.ActiveProcess = "External";
}
private static void BuildTransitionFromChecks(ConsistencyChecks cc, ProcedureInfo proc)