public static void Import11x5C5CX() { var numberTypes = NumberTypeBiz.Instance.GetAll().Where(x => x.RuleType.Contains("11X5")).Where(y => y.Code.StartsWith("A")); string[] dmType1 = new string[] { "He" }; foreach (var numberType in numberTypes) { Data.SQLServer.D11X5.DmC5CXBiz biz = new Data.SQLServer.D11X5.DmC5CXBiz("jiangx11x5"); List<DimensionNumberType> ntds = ntds = biz.DataAccessor.SelectNumberTypeDimGroupBy(dmType1, numberType.Code.Replace("A", "C")); int nums = ntds[0].Nums; foreach (var ntd in ntds) { ntd.NumberType = numberType.Code; ntd.RuleType = numberType.RuleType; ntd.Amount = (ntd.Nums / nums) * numberType.Amount; ntd.Probability = (ntd.Nums * 1.0) / 462.00; ntd.Nums = ntd.Nums / nums; } DimensionNumberTypeBiz.Instance.DataAccessor.Insert(ntds, SqlInsertMethod.SqlBulkCopy); } }
public static void Import11x5C5CX() { var numberTypes = NumberTypeBiz.Instance.GetAll().Where(x => x.RuleType.Contains("11X5")).Where(y => y.Code.StartsWith("A")); string[] dmType1 = new string[] { "He" }; foreach (var numberType in numberTypes) { Data.SQLServer.D11X5.DmC5CXBiz biz = new Data.SQLServer.D11X5.DmC5CXBiz("jiangx11x5"); List <DimensionNumberType> ntds = ntds = biz.DataAccessor.SelectNumberTypeDimGroupBy(dmType1, numberType.Code.Replace("A", "C")); int nums = ntds[0].Nums; foreach (var ntd in ntds) { ntd.NumberType = numberType.Code; ntd.RuleType = numberType.RuleType; ntd.Amount = (ntd.Nums / nums) * numberType.Amount; ntd.Probability = (ntd.Nums * 1.0) / 462.00; ntd.Nums = ntd.Nums / nums; } DimensionNumberTypeBiz.Instance.DataAccessor.Insert(ntds, SqlInsertMethod.SqlBulkCopy); } }