public void StatC5CX(List<DwNumber> numbers, string dbName) { string[] dmNames = new string[] { "Peroid", "He" }; string[] numberTypes = new string[] { "A2", "A3", "A4", "A6", "A7", "A8" }; DwC5CXSpanBiz spanBiz = new DwC5CXSpanBiz(dbName); foreach (var numberType in numberTypes) { Dictionary<string, Dictionary<string, int>> lastSpanDict = new Dictionary<string, Dictionary<string, int>>(16); List<DwC5CXSpan> c5cxSpans = new List<DwC5CXSpan>(numbers.Count * 20); string newNumberType = numberType.Replace("A", "C"); string tableName = string.Format("{0}{1}", "C5", newNumberType); spanBiz.DataAccessor.TableName = ConfigHelper.GetDwSpanTableName(tableName); long lastP = spanBiz.DataAccessor.SelectLatestPeroid(string.Empty); foreach (DwNumber number in numbers) { var cxNumbers = NumberCache.Instance.GetC5CXNumbers(number.C5, newNumberType); var c5cxSpanList = this.GetC5CXSpanList(lastSpanDict, cxNumbers, number, dmNames); if (number.P > lastP) c5cxSpans.AddRange(c5cxSpanList); } spanBiz.DataAccessor.Insert(c5cxSpans, SqlInsertMethod.SqlBulkCopy); Console.WriteLine("{0} {1} Finished", dbName, tableName); } Console.WriteLine("{0} {1} Finished", dbName, "ALL C5CX Span"); }
public void StatC5CX(List <DwNumber> numbers, string dbName) { string[] dmNames = new string[] { "Peroid", "He" }; string[] numberTypes = new string[] { "A2", "A3", "A4", "A6", "A7", "A8" }; DwC5CXSpanBiz spanBiz = new DwC5CXSpanBiz(dbName); foreach (var numberType in numberTypes) { Dictionary <string, Dictionary <string, int> > lastSpanDict = new Dictionary <string, Dictionary <string, int> >(16); List <DwC5CXSpan> c5cxSpans = new List <DwC5CXSpan>(numbers.Count * 20); string newNumberType = numberType.Replace("A", "C"); string tableName = string.Format("{0}{1}", "C5", newNumberType); spanBiz.DataAccessor.TableName = ConfigHelper.GetDwSpanTableName(tableName); long lastP = spanBiz.DataAccessor.SelectLatestPeroid(string.Empty); foreach (DwNumber number in numbers) { var cxNumbers = NumberCache.Instance.GetC5CXNumbers(number.C5, newNumberType); var c5cxSpanList = this.GetC5CXSpanList(lastSpanDict, cxNumbers, number, dmNames); if (number.P > lastP) { c5cxSpans.AddRange(c5cxSpanList); } } spanBiz.DataAccessor.Insert(c5cxSpans, SqlInsertMethod.SqlBulkCopy); Console.WriteLine("{0} {1} Finished", dbName, tableName); } Console.WriteLine("{0} {1} Finished", dbName, "ALL C5CX Span"); }
private void CheckC5CX(Action<string> output, Category category,string connectionString) { string[] c5cxs = new string[] { "C5C2", "C5C3", "C5C4", "C5C6", "C5C7", "C5C8" }; DwC5CXSpanBiz c5cxbiz = new DwC5CXSpanBiz(category.DbName); c5cxbiz.DataAccessor.ConnectionString = connectionString; foreach (string c5cx in c5cxs) { c5cxbiz.DataAccessor.TableName = ConfigHelper.GetDwSpanTableName(c5cx); int peroidCount = c5cxbiz.DataAccessor.Count(); int maxSeq = c5cxbiz.DataAccessor.SelectMaxWithCondition("Seq", 10, string.Empty); string propmt = string.Format("{0}:{1}", category.Name + "-" + c5cx, string.Format("{0}期,下载,Max Seq,{1}", peroidCount, maxSeq)); output(propmt); } }
private void CheckC5CX(Action <string> output, Category category, string connectionString) { string[] c5cxs = new string[] { "C5C2", "C5C3", "C5C4", "C5C6", "C5C7", "C5C8" }; DwC5CXSpanBiz c5cxbiz = new DwC5CXSpanBiz(category.DbName); c5cxbiz.DataAccessor.ConnectionString = connectionString; foreach (string c5cx in c5cxs) { c5cxbiz.DataAccessor.TableName = ConfigHelper.GetDwSpanTableName(c5cx); int peroidCount = c5cxbiz.DataAccessor.Count(); int maxSeq = c5cxbiz.DataAccessor.SelectMaxWithCondition("Seq", 10, string.Empty); string propmt = string.Format("{0}:{1}", category.Name + "-" + c5cx, string.Format("{0}期,下载,Max Seq,{1}", peroidCount, maxSeq)); output(propmt); } }