private void CheckKspd2(Td_Kc_Kspd_2 model, BaseResult br) { if ( string.IsNullOrEmpty(model.id_shopsp) || string.IsNullOrEmpty(model.id_sp) || string.IsNullOrEmpty(model.id_kcsp) || model.zhl <= 0 || string.IsNullOrEmpty(model.barcode)) { br.Success = false; br.Message.Add(string.Format("第{0}行商品数据异常", model.sort_id)); return; } if (model.sl < 0) { br.Success = false; br.Message.Add(string.Format("第{0}行商品实盘数量不能为0", model.sort_id)); return; } if (model.sl_total < 0) { br.Success = false; br.Message.Add(string.Format("第{0}行商品总数量不能为0", model.sort_id)); return; } }
/// <summary> /// 初步检验表体数据 /// </summary> /// <param name="model"></param> /// <param name="message"></param> /// <returns></returns> public bool ParamError(Td_Kc_Kspd_2 model, out string message) { message = ""; if (model == null) { message = "参数不能为空!"; return(true); } else { if (!CyVerify.IsNumeric(model.sort_id) || model.sort_id <= 0) { message = "序号不符合要求!"; return(true); } else if (string.IsNullOrEmpty(model.id_shopsp)) { message = "商品id不符合要求!"; return(true); } else if (string.IsNullOrEmpty(model.id_kcsp)) { message = "库存id不符合要求!"; return(true); } else if (string.IsNullOrEmpty(model.barcode)) { message = "条码不符合要求!"; return(true); } else if (string.IsNullOrEmpty(model.dw)) { message = "单位不符合要求!"; return(true); } return(false); } }