public override void CheckParam() { Handle(); base.CheckParam(); if (string.IsNullOrEmpty(sp) || !sp.Contains("id_object")) { Errors.Add("请选择商品分类!"); return; } if (Promote2List.Any()) { Promote2List.ForEach(promote2 => { if (promote2.zh_group != "A") { #region 折扣 if (promote2.condition_2 > 0 && promote2.condition_2 <= promote2.condition_1) { Errors.Add(string.Format("商品分类:第{0}行,规则二的条件必需大于规则一的条件!", promote2.sort_id)); } if (promote2.condition_3 > 0 && promote2.condition_3 <= promote2.condition_2) { Errors.Add(string.Format("商品分类:第{0}行,规则三的条件必需大于规则二的条件!", promote2.sort_id)); } if (promote2.result_2 > 0 && promote2.result_2 >= promote2.result_1) { Errors.Add(string.Format("商品分类:第{0}行,规则二折扣必需小于规则一折扣!", promote2.sort_id)); } if (promote2.result_3 > 0 && promote2.result_3 >= promote2.result_2) { Errors.Add(string.Format("商品分类:第{0}行,规则三折扣必需小于规则二折扣!", promote2.sort_id)); } if (promote2.result_1 > 1 || promote2.result_1 < 0) { Errors.Add(string.Format("商品分类:第{0}行,规则一的折扣只能设置0-1的数!", promote2.sort_id)); } if (promote2.result_2 > 1 || promote2.result_2 < 0) { Errors.Add(string.Format("商品分类:第{0}行,规则二的折扣只能设置0-1的数!", promote2.sort_id)); } if (promote2.result_3 > 1 || promote2.result_3 < 0) { Errors.Add(string.Format("商品分类:第{0}行,规则三的折扣只能设置0-1的数!", promote2.sort_id)); } #endregion } }); } if (!PromoteShopList.Any()) { Errors.Add("请选择促销门店!"); } }
public override void CheckParam() { Handle(); base.CheckParam(); #region if (string.IsNullOrEmpty(sp) || !sp.Contains("id_object")) { Errors.Add("请选择商品!"); return; } if (Promote2List.Any()) { Promote2List.ForEach(promote2 => { #region 特价 #region if (promote2.condition_1 == 0 || promote2.result_1 == 0) { Errors.Add(string.Format("商品:第{0}行,请按顺序一、二、三设置规则!", promote2.sort_id)); } if ((promote2.condition_2 == 0 && promote2.condition_3 != 0) || (promote2.result_2 == 0 && promote2.result_3 != 0)) { Errors.Add(string.Format("商品:第{0}行,请按顺序一、二、三设置规则!", promote2.sort_id)); } if ((promote2.condition_2 == 0 && promote2.result_2 != 0) || (promote2.condition_2 != 0 && promote2.result_2 == 0)) { Errors.Add(string.Format("商品:第{0}行,规则二设置不完整!", promote2.sort_id)); } if ((promote2.condition_3 == 0 && promote2.result_3 != 0) || (promote2.condition_3 != 0 && promote2.result_3 == 0)) { Errors.Add(string.Format("商品:第{0}行,规则三设置不完整!", promote2.sort_id)); } #endregion if (promote2.condition_2 > 0 && promote2.condition_2 <= promote2.condition_1) { Errors.Add(string.Format("商品:第{0}行,规则二的条件必需大于规则一的条件!", promote2.sort_id)); } if (promote2.condition_3 > 0 && promote2.condition_3 <= promote2.condition_2) { Errors.Add(string.Format("商品:第{0}行,规则三的条件必需大于规则二的条件!", promote2.sort_id)); } #endregion }); } #endregion if (!PromoteShopList.Any()) { Errors.Add("请选择促销门店!"); } }
public override void HandlePromote2List() { Promote2List = JSON.Deserialize <List <Td_Promote_2> >(sp); var date = DateTime.Now; if (Promote2List.Any()) { for (int i = 0; i < Promote2List.Count; i++) { var p = Promote2List[i]; p.id = Guid.NewGuid().ToString(); p.zh_group = "A"; p.id_masteruser = id_masteruser; p.rq_create = date; p.sort_id = i + 1; p.id_bill = id; } } }
public override void CheckParam() { Handle(); base.CheckParam(); if (Promote2List.Any()) { Promote2List.ForEach(promote2 => { #region 折扣 if (promote2.condition_1 == 0 || promote2.result_1 == 0) { Errors.Add(string.Format("商品:第{0}行,请按顺序一、二、三设置规则!", promote2.sort_id)); } if ((promote2.condition_2 == 0 && promote2.condition_3 != 0) || (promote2.result_2 == 0 && promote2.result_3 != 0)) { Errors.Add(string.Format("商品:第{0}行,请按顺序一、二、三设置规则!", promote2.sort_id)); } if ((promote2.condition_2 == 0 && promote2.result_2 != 0) || (promote2.condition_2 != 0 && promote2.result_2 == 0)) { Errors.Add(string.Format("商品:第{0}行,规则二设置不完整!", promote2.sort_id)); } if ((promote2.condition_3 == 0 && promote2.result_3 != 0) || (promote2.condition_3 != 0 && promote2.result_3 == 0)) { Errors.Add(string.Format("商品:第{0}行,规则三设置不完整!", promote2.sort_id)); } if (promote2.condition_2 > 0 && promote2.condition_2 <= promote2.condition_1) { Errors.Add(string.Format("商品:第{0}行,规则二的条件必需大于规则一的条件!", promote2.sort_id)); } if (promote2.condition_3 > 0 && promote2.condition_3 <= promote2.condition_2) { Errors.Add(string.Format("商品:第{0}行,规则三的条件不能小于规则二的条件!", promote2.sort_id)); } if (promote2.result_2 > 0 && promote2.result_2 >= promote2.result_1) { Errors.Add(string.Format("商品:第{0}行,规则二折扣必需小于规则一折扣!", promote2.sort_id)); } if (promote2.result_3 > 0 && promote2.result_3 >= promote2.result_2) { Errors.Add(string.Format("商品:第{0}行,规则三折扣必需小于规则二折扣!", promote2.sort_id)); } if (promote2.result_1 > 1 || promote2.result_1 < 0) { Errors.Add(string.Format("商品:第{0}行,规则一的折扣只能设置0-1的数!", promote2.sort_id)); } if (promote2.result_2 > 1 || promote2.result_2 < 0) { Errors.Add(string.Format("商品:第{0}行,规则二的折扣只能设置0-1的数!", promote2.sort_id)); } if (promote2.result_3 > 1 || promote2.result_3 < 0) { Errors.Add(string.Format("商品:第{0}行,规则三的折扣只能设置0-1的数!", promote2.sort_id)); } #endregion }); } else { Errors.Add("请选择商品!"); return; } if (!PromoteShopList.Any()) { Errors.Add("请选择促销门店!"); } }