From 8489c847b36887b2b42a71b2ca2ab51171de579c Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 10 Apr 2008 13:48:03 +0000 Subject: [PATCH] --- PROMS/DataLoader/RefObjs.cs | 11 +-- PROMS/DataLoader/Transitions.cs | 135 +------------------------------- 2 files changed, 7 insertions(+), 139 deletions(-) diff --git a/PROMS/DataLoader/RefObjs.cs b/PROMS/DataLoader/RefObjs.cs index 08395ecd..b9eb6a63 100644 --- a/PROMS/DataLoader/RefObjs.cs +++ b/PROMS/DataLoader/RefObjs.cs @@ -62,14 +62,9 @@ namespace DataLoader DataRow dr = dt.Rows[instance]; string ROID = dr["ROID"].ToString(); RoUsage ro = RoUsage.MakeRoUsage(content, ROID, null, DateTime.Now, "Migration"); - rotxt.Append("\x15\\v RO\\v0 "); - string val = rofst.GetRoValue(ROID.Substring(0, 12).ToUpper()); - rotxt.Append(val); - rotxt.Append("\\v #"); - rotxt.Append(ro.ROUsageID.ToString()); - rotxt.Append(" "); - rotxt.Append(ROID); - rotxt.Append("\\v0 "); + string results = string.Format(@"{0}{1}\v #Link:ReferencedObject:{2} {3}\v0", + '\x15', rofst.GetRoValue(ROID.Substring(0, 12).ToUpper()), ro.ROUsageID, ROID); + rotxt.Append(results); instance++; } else diff --git a/PROMS/DataLoader/Transitions.cs b/PROMS/DataLoader/Transitions.cs index d1f62a19..8959168b 100644 --- a/PROMS/DataLoader/Transitions.cs +++ b/PROMS/DataLoader/Transitions.cs @@ -72,15 +72,6 @@ namespace DataLoader } DateTime dts = GetDTS(MakeDate(dti.Substring(0, 8).Trim()), dti.Substring(8, 5).Trim()); - //// if this is an Outside Transition, then decode the ToTrans to the procedure set path and - // // procedure number. This will be saved in the tr.MyZTransition.Oldto for now. - // // Then, after all the set are processed, we'll grab these and find the proper ITEM for - // // the transition reference. - // if (itype == 6) // Outside Transition - // { - // = ProcessOutSideTrans(cn, thekey, pth); - // } - // if it's in the dictionary of structure elements already migrated, just use this // structure id, or if it's in the dictionary of structure elements that have // not been migrated but a record was created from this code, use it. Otherwise @@ -168,132 +159,14 @@ namespace DataLoader log.Error("Error addition transition record"); log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException); } - StringBuilder trtxt = new StringBuilder(); - - // the following is pre RTB link code, i.e. {tranid {type toid (rangeid}} - trtxt.Append("\\v TRAN\\v0 (Resolved Transition Text)\\v "); - - trtxt.Append(tr.TranType.ToString()); - trtxt.Append(" "); - trtxt.Append(tr.TransitionID.ToString()); - trtxt.Append(" "); - trtxt.Append(tr.ToID.ToString()); + string results = null; if (toItem.ItemID == toItem2.ItemID) - trtxt.Append("\\v0 "); + results = string.Format(@"(Resolved Transition Text)\v #Link:Transition:{0} {1} {2}\v0", tr.TranType, tr.TransitionID, tr.ToID); else - { - trtxt.Append(" "); - trtxt.Append(tr.RangeID.ToString()); - trtxt.Append("\\v0 "); - } - //trtxt.Append("{"); - //trtxt.Append(tr.TransitionID.ToString()); - //trtxt.Append("{"); - //trtxt.Append(tr.TranType.ToString()); - //trtxt.Append(" "); - //trtxt.Append(tr.ToID.ToString()); - //if (toItem.ItemID == toItem2.ItemID) - // trtxt.Append("}}"); - //else - //{ - // trtxt.Append(" "); - // trtxt.Append(tr.RangeID.ToString()); - // trtxt.Append("}}"); - //} - - return trtxt.ToString(); + results = string.Format(@"(Resolved Transition Text)\v #Link:TransitionRange:{0} {1} {2} {3}\v0", tr.TranType, tr.TransitionID, tr.ToID, tr.RangeID); + return results; } - //private bool pathsAreEqual(string setpth, string pth) - //{ - // bool eql = false; - // string cpth = (pth.Substring(3)).ToUpper(); - // string spth = setpth.ToUpper(); - // eql = cpth.Equals(spth); - // if (!eql) // full path not equal, check for a partial path match - // { - // int idx = spth.LastIndexOf('\\'); - // idx = spth.LastIndexOf('\\', idx - 1); - // spth = spth.Substring(idx); - // idx = cpth.LastIndexOf('\\'); - // idx = cpth.LastIndexOf('\\', idx - 1); - // cpth = cpth.Substring(idx); - // eql = (cpth.Equals(spth)); - // } - // return eql; - //} - - //private string ProcessOutSideTrans(OleDbConnection cn, string thekey, string pth) - //{ - // string xtransstring = null; - // DataTable dt = null; - // DataSet ds = null; - // OleDbDataAdapter da = null; - - // DataTable dt2 = null; - // DataSet ds2 = null; - // OleDbDataAdapter da2 = null; - - // string tosetid = thekey.Substring(0, 8); - // string toprocid = thekey.Substring(8, 8); - - // /// Get the path to the procedure set from the SETID - // string xtsetcmd = "SELECT * FROM [xtsetid] WHERE [SETID]='" + tosetid +"'"; - // string xtproccmd = "SELECT * FROM [xtprocid] WHERE [SETID]='" + tosetid +"' AND [PROCID]='" + toprocid +"'"; - - // da = new OleDbDataAdapter(xtsetcmd, cn); - // da2 = new OleDbDataAdapter(xtproccmd, cn); - - // // get xtsetid records. - // ds = new DataSet(); - // try - // { - // da.Fill(ds); - // dt = ds.Tables[0]; - // dt.CaseSensitive = true; - // } - // catch (Exception ex) - // { - // log.Error("Error getting XTSETID"); - // log.ErrorFormat("to number = {0}", thekey); - // log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException); - // //return textm; - // } - // DataRow dr = dt.Rows[0]; // there should be only one entry! - // string setpth = dr["Path"].ToString(); // this should be the path to the proc set! - - // // get xtprocid records - // ds2 = new DataSet(); - // try - // { - // da2.Fill(ds2); - // dt2 = ds2.Tables[0]; - // dt2.CaseSensitive = true; - // } - // catch (Exception ex) - // { - // log.Error("Error getting XTPROCID"); - // log.ErrorFormat("to number = {0}", thekey); - // log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException); - // //return textm; - // } - // DataRow dr2 = dt2.Rows[0]; // there should be only one entry! - // string procnum = dr2["Procnum"].ToString(); // this should be the procedure number! - - // xtransstring = setpth + "\\" + procnum; // ex: VEHLP\PROCS\0POP05-EO00 - - // //if (pathsAreEqual(setpth, pth)) - // //{ - // // // Outside Transiton is to this procedure set (not really outsde) - // // // need to find the item id that references the proc number and title - // // // - find the setpth in the doc.version - // //} - // //else - // //return thekey; // is a true outside transition - - // return xtransstring; - //} - private string MigrateTrans(OleDbConnection cn, string textm, string seqcvt, Content content, string pth) { StringBuilder trtxt = new StringBuilder();