public static void Import11x5()
        {
            List<NumberType> numberTypes = NumberTypeBiz.Instance.GetAll().Where(x => x.RuleType.Contains("11X5")).ToList();
            string[] number1 = new string[] { "DaXiao", "DanShuang", "ZiHe", "Lu012" };
            string[] number2 = new string[] { "DaXiao", "DanShuang", "ZiHe", "Lu012", "He", "HeWei", "Ji", "JiWei", "KuaDu", "DaXiaoBi", "ZiHeBi", "DanShuangBi", "Lu012Bi" };
            string[] number3 = new string[] { "DaXiao", "DanShuang", "ZiHe", "Lu012", "He", "HeWei", "Ji", "JiWei", "KuaDu", "AC", "DaXiaoBi", "ZiHeBi", "DanShuangBi", "Lu012Bi" };

            foreach (var numberType in numberTypes)
            {
                if (numberType.Code.StartsWith("A")) continue;

                Data.Biz.D11X5.DmDPCBiz biz = new Data.Biz.D11X5.DmDPCBiz("jiangx11x5", numberType.Code.GetDmTableSuffix());
                List<DimensionNumberType> ntds = new List<DimensionNumberType>();
                if (numberType.Length == 1)
                    ntds = biz.DataAccessor.SelectNumberTypeDimGroupBy(number1, numberType.Code);
                else if (numberType.Length == 2)
                    ntds = biz.DataAccessor.SelectNumberTypeDimGroupBy(number2, numberType.Code);
                else
                    ntds = biz.DataAccessor.SelectNumberTypeDimGroupBy(number3, numberType.Code);

                foreach (var ntd in ntds)
                {
                    ntd.NumberType = numberType.Code;
                    ntd.RuleType = numberType.RuleType;
                    ntd.Amount = ntd.Nums * numberType.Amount;
                    ntd.Probability = (ntd.Nums * 1.0) * numberType.Probability;
                }
                DimensionNumberTypeBiz.Instance.DataAccessor.Insert(ntds, SqlInsertMethod.SqlBulkCopy);
            }
        }
예제 #2
0
        public static void Import11x5()
        {
            List <NumberType> numberTypes = NumberTypeBiz.Instance.GetAll().Where(x => x.RuleType.Contains("11X5")).ToList();

            string[] number1 = new string[] { "DaXiao", "DanShuang", "ZiHe", "Lu012" };
            string[] number2 = new string[] { "DaXiao", "DanShuang", "ZiHe", "Lu012", "He", "HeWei", "Ji", "JiWei", "KuaDu", "DaXiaoBi", "ZiHeBi", "DanShuangBi", "Lu012Bi" };
            string[] number3 = new string[] { "DaXiao", "DanShuang", "ZiHe", "Lu012", "He", "HeWei", "Ji", "JiWei", "KuaDu", "AC", "DaXiaoBi", "ZiHeBi", "DanShuangBi", "Lu012Bi" };

            foreach (var numberType in numberTypes)
            {
                if (numberType.Code.StartsWith("A"))
                {
                    continue;
                }

                Data.Biz.D11X5.DmDPCBiz    biz  = new Data.Biz.D11X5.DmDPCBiz("jiangx11x5", numberType.Code.GetDmTableSuffix());
                List <DimensionNumberType> ntds = new List <DimensionNumberType>();
                if (numberType.Length == 1)
                {
                    ntds = biz.DataAccessor.SelectNumberTypeDimGroupBy(number1, numberType.Code);
                }
                else if (numberType.Length == 2)
                {
                    ntds = biz.DataAccessor.SelectNumberTypeDimGroupBy(number2, numberType.Code);
                }
                else
                {
                    ntds = biz.DataAccessor.SelectNumberTypeDimGroupBy(number3, numberType.Code);
                }

                foreach (var ntd in ntds)
                {
                    ntd.NumberType  = numberType.Code;
                    ntd.RuleType    = numberType.RuleType;
                    ntd.Amount      = ntd.Nums * numberType.Amount;
                    ntd.Probability = (ntd.Nums * 1.0) * numberType.Probability;
                }
                DimensionNumberTypeBiz.Instance.DataAccessor.Insert(ntds, SqlInsertMethod.SqlBulkCopy);
            }
        }