Exemple #1
0
        private BaseResult HandleOpenPayConfig(BaseResult res, OpenPayConfigModel model)
        {
            if (model == null ||
                string.IsNullOrEmpty(model.id) ||
                string.IsNullOrEmpty(model.id_is_use) ||
                string.IsNullOrEmpty(model.id_masteruser) ||
                string.IsNullOrEmpty(model.parmvalue_is_use))
            {
                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());
            DAL.UpdatePart(typeof(Tb_Pay_Config), param);
            if (model.ope_type == "open")
            {
                param.Clear();
                param.Add("id", model.id_is_use);
                param.Add("new_parmvalue", model.parmvalue_is_use.Trim());
                DAL.UpdatePart(typeof(Tb_Pay_Config), param);
            }
            return(res);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        public ActionResult OpenPay(OpenPayConfigModel model)
        {
            var res = HandleResult(() =>
            {
                model.id_masteruser = id_user_master;
                return(BusinessFactory.Tb_Pay_Config.Update(model));
            });

            return(JsonString(res, 1));
        }