Example #1
0
        /// <summary>
        ///     更新一条数据
        /// </summary>
        public bool Update(PaymentInfo model)
        {
            if (model == null)
                return false;

            _efRepository.Update(model);
            return true;
        }
Example #2
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var wxpayBll = new PaymentService();
            int id = MyCommFun.Obj2Int(hidId.Value, 0);
            var wxpayModel = new PaymentInfo();
            var weixin = GetWeiXinCode();
            if (id == 0)
            {
                //新增

                wxpayModel.AppId = weixin.Id;
                wxpayModel.CreateDate = DateTime.Now;
            }
            else
            {
                //修改
                wxpayModel = wxpayBll.GetModel(id);
            }

            wxpayModel.MchId = txtmch_id.Text.Trim();
            wxpayModel.Paykey = txtpaykey.Text.Trim();
            wxpayModel.CertInfoPath = txtcertInfoPath.Text.Trim();
            wxpayModel.CerInfoPwd = txtcerInfoPwd.Text.Trim();

            bool ret = false;
            if (id == 0)
            {
                wxpayModel.CreateDate = DateTime.Now;
                int retNum = wxpayBll.Add(wxpayModel);
                if (retNum > 0)
                {
                    ret = true;
                }
            }
            else
            {
                ret = wxpayBll.Update(wxpayModel);
            }

            //OpenOAuth开启
            var propertyBll = new PropertyService(new PropertyRepository());
            string pValue = radOpenOAuth.SelectedItem.Value;
            propertyBll.AddProperty(weixin.Id, MXEnums.WXPropertyKeyName.OpenOauth.ToString(), pValue);

            if (ret)
            {
                JscriptMsg("修改信息成功!", "baseSetting.aspx", "Success");
            }
            else
            {
                JscriptMsg("修改信息成功!", "", "Error");
                return;
            }

        }
Example #3
0
        /// <summary>
        ///     增加一条数据
        /// </summary>
        public int Add(PaymentInfo model)
        {
            if (model != null)
            {
                _efRepository.Add(model);

                return model.Id;
            }

            return 0;
        }
Example #4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(PaymentInfo model)
 {
     return _repository.Update(model);
 }
Example #5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(PaymentInfo model)
 {
     return _repository.Add(model);
 }