From 90a7a6dbc0b70b77bcf18a08bc1d2610b9526226 Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 6 Sep 2010 19:31:52 +0000 Subject: [PATCH] - Added code to handle missing A0 Section Transitions - Added code to handle "AND Range" transitions - Fixed code to replace transition tokens. It was removing the last character. Added Background Saving --- PROMS/DataLoader/Transitions.cs | 14 +++++++++++++- PROMS/LBWordLibrary/LBComObject.cs | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/PROMS/DataLoader/Transitions.cs b/PROMS/DataLoader/Transitions.cs index c707c7d1..6e13c97e 100644 --- a/PROMS/DataLoader/Transitions.cs +++ b/PROMS/DataLoader/Transitions.cs @@ -100,6 +100,10 @@ namespace DataLoader } else { + // if the type == 0, i.e. procedure with optional step number and the procedure does not include + // the default A0 section, point to the procedure: + if (itype == 0 && thekey.EndsWith("A0")) // may have to process these at end? + Console.WriteLine("here"); if (itype > 6) itype--; // Corrected to match transformat table (16-bit skips type 6 because it's an outside transition) if (dicTrans_ItemDone.ContainsKey(thekey)) { @@ -131,6 +135,14 @@ namespace DataLoader if (dr2 != null) { string thekey2 = dr2["TONUMBER"].ToString() + "|" + dr2["TOSEQUENCE"].ToString(); + if (itype == 2) + { + if (dr["TOSEQUENCE"].ToString().Length > 3 && + dr["TOSEQUENCE"].ToString().Substring(0, 2) == dr2["TOSEQUENCE"].ToString().Substring(0, 2)) + thekey2 = thekey; + else + thekey2 = dr2["TONUMBER"].ToString() + "|" + dr2["TOSEQUENCE"].ToString().Substring(0, 3); + } if (dicTrans_ItemDone.ContainsKey(thekey2)) { toItem2 = dicTrans_ItemDone[thekey2]; @@ -260,7 +272,7 @@ namespace DataLoader else tok = textm.IndexOfAny(chrtrn, beg); } - if (beg < textm.Length - 1) + if (beg < textm.Length) trtxt.Append(textm.Substring(beg, textm.Length - beg)); if (dt.Rows.Count > instance + 1) { diff --git a/PROMS/LBWordLibrary/LBComObject.cs b/PROMS/LBWordLibrary/LBComObject.cs index b5a946d0..3bd7d31c 100644 --- a/PROMS/LBWordLibrary/LBComObject.cs +++ b/PROMS/LBWordLibrary/LBComObject.cs @@ -140,6 +140,10 @@ namespace LBWordLibrary get { return (LBWdWindowState)GetProperty("WindowState"); } set { SetProperty("WindowState", value); } } + public int BackgroundSavingStatus + { + get { return (GetProperty("BackgroundSavingStatus") as int? ?? 0); } + } public void Quit() { InvokeMethod("Quit", Missing.Value, Missing.Value, Missing.Value);