private DwC5CXSpan GetC5CXSpan(Dictionary<string, Dictionary<string, int>> lastSpanDict, DwNumber number, string[] dmNames, DmC5CX cxNumber) { DwC5CXSpan c5cxSpan = new DwC5CXSpan(); c5cxSpan.P = number.P; c5cxSpan.Seq = number.Seq; c5cxSpan.C5 = number.C5; c5cxSpan.CX = cxNumber.CX; foreach (string dmName in dmNames) { if (!lastSpanDict.ContainsKey(dmName)) lastSpanDict.Add(dmName, new Dictionary<string, int>(1000)); string propertyName = dmName + "Spans"; int spans = number.Seq - 1; string dmValue = cxNumber.CX.GetDmValue(2, dmName, 5); if (lastSpanDict[dmName].ContainsKey(dmValue)) { spans = number.Seq - lastSpanDict[dmName][dmValue] - 1; lastSpanDict[dmName][dmValue] = number.Seq; } else { lastSpanDict[dmName].Add(dmValue, number.Seq); } c5cxSpan[propertyName] = spans; } return c5cxSpan; }
private DwC5CXSpan GetC5CXSpan(Dictionary <string, Dictionary <string, int> > lastSpanDict, DwNumber number, string[] dmNames, DmC5CX cxNumber) { DwC5CXSpan c5cxSpan = new DwC5CXSpan(); c5cxSpan.P = number.P; c5cxSpan.Seq = number.Seq; c5cxSpan.C5 = number.C5; c5cxSpan.CX = cxNumber.CX; foreach (string dmName in dmNames) { if (!lastSpanDict.ContainsKey(dmName)) { lastSpanDict.Add(dmName, new Dictionary <string, int>(1000)); } string propertyName = dmName + "Spans"; int spans = number.Seq - 1; string dmValue = cxNumber.CX.GetDmValue(2, dmName, 5); if (lastSpanDict[dmName].ContainsKey(dmValue)) { spans = number.Seq - lastSpanDict[dmName][dmValue] - 1; lastSpanDict[dmName][dmValue] = number.Seq; } else { lastSpanDict[dmName].Add(dmValue, number.Seq); } c5cxSpan[propertyName] = spans; } return(c5cxSpan); }
private List <DwC5CXSpan> GetC5CXSpanList(Dictionary <string, Dictionary <string, int> > lastSpanDict, List <DmC5CX> cxNumbers, DwNumber number, string[] dmNames) { List <DwC5CXSpan> c5cxSpans = new List <DwC5CXSpan>(cxNumbers.Count); foreach (var cxNumber in cxNumbers) { DwC5CXSpan c5cxSpan = this.GetC5CXSpan(lastSpanDict, number, dmNames, cxNumber); c5cxSpans.Add(c5cxSpan); } return(c5cxSpans); }
private List <BatchEntity <DwC5CXSpan> > GetC5CXSpans(Dictionary <string, Dictionary <string, int> > lastSpanDict, List <DmC5CX> c5cxNumbers, DwNumber number, string tableName, string[] dmNames) { List <BatchEntity <DwC5CXSpan> > c5cxSpans = new List <BatchEntity <DwC5CXSpan> >(c5cxNumbers.Count); foreach (var c5cxNumber in c5cxNumbers) { DwC5CXSpan c5cxSpan = new DwC5CXSpan() { P = number.P, Seq = number.Seq, C5 = number.C5, CX = c5cxNumber.CX }; foreach (string dmName in dmNames) { string propertyName = dmName + "Spans"; c5cxSpan[propertyName] = lastSpanDict[dmName][c5cxNumber.CX]; } c5cxSpans.Add(new BatchEntity <DwC5CXSpan>(c5cxSpan, tableName)); } return(c5cxSpans); }