Esempio n. 1
0
        protected override bool Down12X3(DownParameter param)
        {
            Biz.D12X3.DwNumberBiz biz = new Biz.D12X3.DwNumberBiz(param.Category.DbName);
            DateTime lastDate         = biz.GetLatestDate();

            var numbers = this.GetNumbers(param, lastDate);

            if (numbers.Count == 0)
            {
                return(false);
            }

            long lastP = biz.GetLatestPeroid();

            foreach (var numberInfo in numbers)
            {
                string   code     = numberInfo.Number;
                DateTime datetime = DateTime.Parse(numberInfo.DateTime);
                int      dateint  = int.Parse(datetime.ToString("yyyyMMdd"));
                int      p        = 2000000000 + int.Parse(numberInfo.Peroid);
                int      n        = int.Parse(numberInfo.Peroid.Substring(numberInfo.Peroid.Length - 2));

                if (p <= lastP)
                {
                    continue;
                }
                if (biz.Add(p, n, code, dateint, numberInfo.DateTime))
                {
                    continue;
                }
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        protected override bool Down12X3(DownParameter param)
        {
            Biz.D12X3.DwNumberBiz biz = new Biz.D12X3.DwNumberBiz(param.Category.DbName);
            DateTime lastDate = biz.GetLatestDate();

            int endIndex = this.GetEndIndex(param, lastDate);
            if (endIndex <= 0) return false;
            var numbers = this.GetNumbers(param, endIndex);
            if (numbers.Count == 0) return false;

            long lastP = biz.GetLatestPeroid();
            foreach (var numberInfo in numbers)
            {
                string code = numberInfo.Number.Replace(" ", ",");
                DateTime datetime = DateTime.Parse(numberInfo.DateTime);
                int dateint = int.Parse(datetime.ToString("yyyyMMdd"));
                int p = 2000000000 + int.Parse(numberInfo.Peroid);
                int n = int.Parse(numberInfo.Peroid.Substring(numberInfo.Peroid.Length - 2));

                if (p <= lastP) continue;
                if (biz.Add(p, n, code, dateint, numberInfo.DateTime)) continue;
                return false;
            }
            return true;
        }