private BaseResult HandleTbPayConfig(BaseResult res, Tb_Pay_Config model) { if (model == null || string.IsNullOrEmpty(model.id)) { res.Success = false; res.Message.Add("参数有误!"); return(res); } if (string.IsNullOrEmpty(model.parmvalue)) { res.Success = false; res.Message.Add("支付参数不能为空!"); return(res); } Hashtable param = new Hashtable(); param.Add("id", model.id); param.Add("new_parmvalue", model.parmvalue.Trim()); if (DAL.UpdatePart(typeof(Tb_Pay_Config), param) <= 0) { res.Success = false; res.Message.Add("操作失败!"); } return(res); }
public override BaseResult Update(dynamic entity) { BaseResult res = new BaseResult() { Success = true }; Tb_Pay_Config model = entity as Tb_Pay_Config; if (model != null) { return(HandleTbPayConfig(res, model)); } SetPayConfigModel config = entity as SetPayConfigModel; if (config != null) { return(HandleTbPayConfig(res, config)); } OpenPayConfigModel openPayConfigModel = entity as OpenPayConfigModel; if (openPayConfigModel != null) { return(HandleOpenPayConfig(res, openPayConfigModel)); } List <Tb_Pay_Config> list = entity as List <Tb_Pay_Config>; if (list != null) { return(HandleListTbPayConfig(res, list)); } res.Success = false; res.Message.Add("参数有误!"); return(res); }
public ActionResult Edit(Tb_Pay_Config model) { var res = HandleResult(() => BusinessFactory.Tb_Pay_Config.Update(model)); return(JsonString(res, 1)); }