From bf9743b0c3cd5eff8fb442516f164bb4ca3ab19b Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 14 Jul 2011 15:55:00 +0000 Subject: [PATCH] --- PROMS/DataLoader/Steps.cs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/PROMS/DataLoader/Steps.cs b/PROMS/DataLoader/Steps.cs index a9fb4cc5..18422fb3 100644 --- a/PROMS/DataLoader/Steps.cs +++ b/PROMS/DataLoader/Steps.cs @@ -52,18 +52,24 @@ namespace DataLoader string newstptyp = null; bool ManualPagebreak = false; char cbittst = StepType.PadRight(2)[0]; + byte cbittstb = (byte) StepType.PadRight(2)[0]; + //Console.WriteLine(string.Format("AddStep() StepType {0} cbitst = {1} OR'd 0x80 = {2}",StepType,Convert.ToInt16(cbittst),(cbittst & 0x80))); if (cbittst != ' ' && (cbittst & 0xFF80) > 1)//(cbittst & 0x80) > 1) { ManualPagebreak = true; - //if (ci == null) ci = new ConfigInfo(null); ci.AddItem("Step", "ManualPagebreak", "True"); - if ((Convert.ToInt16(cbittst)) == 9508) //page break on HIGH5 step type (40) + // conversion from 16bit characters to 32bit strings handles the higher bits differently. + // Thus we cannot do normal 'or'ing/'and'/ing of 0x7f & 0x80 to just get the step + // type without the pagebreak bit. The following two cases 'hardcode' the steptype + // based on that problem. + if ((Convert.ToInt16(cbittst)) == 9508) //page break on HIGH5 step type (40) newstptyp = "40"; + else if ((Convert.ToInt16(cbittst)) == 9618) //page break on LOSS OF AC type + newstptyp = "17"; else newstptyp = StepType.Substring(1, 1); } - // Need the content record for the RO & transitions. //content = Content.MakeContent(null, stptext, 20000 + int.Parse(newstptyp!=null?newstptyp:StepType),null, ManualPagebreak?ci.ToString():null, dts, userid); // 20000 flags step type item & 1 adjusts for 'base' in format files. @@ -79,6 +85,7 @@ namespace DataLoader if (tokrt > -1) { txtdirty = true; + InvalidROs.Clear(); stptext = MigrateRos(cn, stptext, seqcvt, content, docver, conv_caret, ref rotype); stptext = stptext.TrimEnd(" ".ToCharArray()); // if this is a table RO, then save a flag in the config @@ -88,6 +95,7 @@ namespace DataLoader if (tokrt > -1) { txtdirty = true; + InvalidROs.Clear(); stptext = MigrateRos(cn, stptext, seqcvt, content, docver, conv_caret, ref rotype); stptext = stptext.TrimEnd(" ".ToCharArray()); } @@ -156,7 +164,16 @@ namespace DataLoader ia.UserID = "Migration"; item.Save(); } - + if (InvalidROs.Count > 0) + { + foreach (string str in InvalidROs) + { + ItemAnnotation iaro = item.ItemAnnotations.Add(MigrationErrorType); + iaro.SearchText = str; + iaro.UserID = "Migration"; + } + item.Save(); + } if (frType > 0) { parentItem.MyContent.ContentParts.Add(frType, item);