private bool DoAdd(int _id) { Model.wx_userweixin weixin = GetWeiXinCode(); bool result = false; BLL.payment bll = new BLL.payment(); Model.payment model = new Model.payment(); model.title = txtTitle.Text.Trim(); if (cbIsLock.Checked == true) { model.is_lock = 0; } else { model.is_lock = 1; } model.sort_id = int.Parse(txtSortId.Text.Trim()); model.poundage_type = int.Parse(rblPoundageType.SelectedValue); model.poundage_amount = decimal.Parse(txtPoundageAmount.Text.Trim()); model.img_url = txtImgUrl.Text.Trim(); model.remark = txtRemark.Text; model.pTypeId = _id; model.wid = weixin.id; model.api_path = hidApi_path.Value; if (_id == 2) { //支付宝 BLL.wx_payment_alipay aliBll = new BLL.wx_payment_alipay(); Model.wx_payment_alipay alipay = new Model.wx_payment_alipay(); alipay.ownerName = txtAlipaySellerEmail.Text.Trim(); alipay.partner = txtAlipayPartner.Text.Trim(); alipay.e_key = txtAlipayKey.Text.Trim(); alipay.private_key = txtprivate_key.Text.Trim(); alipay.public_key = txtpublic_key.Text.Trim(); alipay.sign_type = "MD5"; alipay.wid = weixin.id; alipay.createDate = DateTime.Now; aliBll.Add(alipay); } else if (_id == 3) { //微支付 BLL.wx_payment_wxpay wxpayBll = new BLL.wx_payment_wxpay(); Model.wx_payment_wxpay wxpay = new Model.wx_payment_wxpay(); wxpay.wid = weixin.id; //财付通--相关信息 wxpay.partnerId = txtpartnerId.Text.Trim(); wxpay.partnerKey = txtpartnerKey.Text.Trim(); wxpay.CertInfoPath = txtCertInfoPath.Text.Trim(); wxpay.partnerPwd = txtPartnerPwd.Text.Trim(); //微信--相关配置 wxpay.paySignKey = txtpaySignKey.Text.Trim(); wxpay.appId = txtAppId.Text.Trim(); wxpay.quicklyFH = rblQuicklyFH.SelectedItem.Value == "1" ? true : false; wxpay.createDate = DateTime.Now; wxpayBll.Add(wxpay); } if (bll.Add(model) > 0) { AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "添加支付方式:" + model.title); //记录日志 result = true; } return(result); }
private bool DoAdd(int _id) { Model.wx_userweixin weixin = GetWeiXinCode(); bool result = false; BLL.payment bll = new BLL.payment(); Model.payment model = new Model.payment(); model.title = txtTitle.Text.Trim(); if (cbIsLock.Checked == true) { model.is_lock = 0; } else { model.is_lock = 1; } model.sort_id = int.Parse(txtSortId.Text.Trim()); model.poundage_type = int.Parse(rblPoundageType.SelectedValue); model.poundage_amount = decimal.Parse(txtPoundageAmount.Text.Trim()); model.img_url = txtImgUrl.Text.Trim(); model.remark = txtRemark.Text; model.pTypeId = _id; model.wid = weixin.id; model.api_path = hidApi_path.Value; if (_id==2) { //支付宝 BLL.wx_payment_alipay aliBll = new BLL.wx_payment_alipay(); Model.wx_payment_alipay alipay = new Model.wx_payment_alipay(); alipay.ownerName = txtAlipaySellerEmail.Text.Trim(); alipay.partner = txtAlipayPartner.Text.Trim(); alipay.e_key = txtAlipayKey.Text.Trim(); alipay.private_key = txtprivate_key.Text.Trim(); alipay.public_key = txtpublic_key.Text.Trim(); alipay.sign_type = "MD5"; alipay.wid = weixin.id; alipay.createDate = DateTime.Now; aliBll.Add(alipay); } else if (_id==3) { //微支付 BLL.wx_payment_wxpay wxpayBll = new BLL.wx_payment_wxpay(); Model.wx_payment_wxpay wxpay = new Model.wx_payment_wxpay(); wxpay.wid = weixin.id; //财付通--相关信息 wxpay.partnerId = txtpartnerId.Text.Trim(); wxpay.partnerKey = txtpartnerKey.Text.Trim(); wxpay.CertInfoPath = txtCertInfoPath.Text.Trim(); wxpay.partnerPwd = txtPartnerPwd.Text.Trim(); //微信--相关配置 wxpay.paySignKey = txtpaySignKey.Text.Trim(); wxpay.appId = txtAppId.Text.Trim(); wxpay.quicklyFH = rblQuicklyFH.SelectedItem.Value == "1" ? true : false; wxpay.createDate = DateTime.Now; wxpayBll.Add(wxpay); } if (bll.Add(model)>0) { AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "添加支付方式:" + model.title); //记录日志 result = true; } return result; }