예제 #1
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.payment   bll   = new BLL.payment();
            Model.payment model = bll.GetModel(_id);

            model.title           = txtTitle.Text.Trim();
            model.img_url         = txtImgUrl.Text.Trim();
            model.remark          = txtRemark.Text;
            model.poundage_type   = int.Parse(rblPoundageType.SelectedValue);
            model.poundage_amount = decimal.Parse(txtPoundageAmount.Text.Trim());
            model.api_path        = txtApiPath.Text.Trim();
            model.redirect_url    = txtRedirectUrl.Text.Trim();
            model.return_url      = txtReturnUrl.Text.Trim();
            model.notify_url      = txtNotifyUrl.Text.Trim();
            if (cbIsLock.Checked == true)
            {
                model.is_lock = 0;
            }
            else
            {
                model.is_lock = 1;
            }
            model.sort_id = ConvertTool.ToInt(txtSortId.Text.Trim(), 99);

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改支付平台:" + model.title); //记录日志
                result = true;
            }

            return(result);
        }
예제 #2
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.payment   bll   = new BLL.payment();
            Model.payment model = bll.GetModel(_id);

            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;
            int payid = MyCommFun.Str2Int(hidPayId.Value);


            if (bll.Update(model))
            {
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改支付方式:" + model.title); //记录日志
                result = true;
            }

            return(result);
        }
예제 #3
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.payment   bll   = new BLL.payment();
            Model.payment model = bll.GetModel(_id);

            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;
            int payid = MyCommFun.Str2Int(hidPayId.Value);

            if (model.pTypeId == 2)
            {
                //支付宝

                Model.wx_payment_alipay alipay = aliBll.GetModel(payid);
                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();
                aliBll.Update(alipay);
            }
            else if (model.pTypeId == 3)
            {
                //微支付
                Model.wx_payment_wxpay wxpay = wxBll.GetModel(payid);
                wxpay.paySignKey = txtpaySignKey.Text.Trim();
                wxpay.partnerId  = txtTenpayPartnerId.Text.Trim();
                wxpay.partnerKey = txtTenpayKey.Text.Trim();
                wxpay.quicklyFH  = rblQuicklyFH.SelectedItem.Value == "1" ? true : false;
                wxpay.appId      = lblAppId.Text.Trim();
                wxBll.Update(wxpay);
            }


            if (bll.Update(model))
            {
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改支付方式:" + model.title); //记录日志
                result = true;
            }

            return(result);
        }
예제 #4
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.payment   bll   = new BLL.payment();
            Model.payment model = bll.GetModel(_id);

            model.title = txtTitle.Text.Trim();
            if (cbIsLock.Checked == true)
            {
                model.is_lock = 0;
            }
            else
            {
                model.is_lock = 1;
            }
            model.is_mobile       = int.Parse(rblIsMobile.SelectedValue);
            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;
            if (model.api_path.ToLower() == "alipaypc")
            {
                //支付宝
                string alipayFilePath = Utils.GetMapPath(siteConfig.webpath + "xmlconfig/alipaypc.config");
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/partner", txtAlipayPartner.Text);
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/key", txtAlipayKey.Text);
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/email", txtAlipaySellerEmail.Text);
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/type", rblAlipayType.SelectedValue);
            }
            else if (model.api_path.ToLower() == "tenpaypc")
            {
                //财付通
                string tenpayFilePath = Utils.GetMapPath(siteConfig.webpath + "xmlconfig/tenpaypc.config");
                XmlHelper.UpdateNodeInnerText(tenpayFilePath, @"Root/partner", txtTenpayBargainorId.Text);
                XmlHelper.UpdateNodeInnerText(tenpayFilePath, @"Root/key", txtTenpayKey.Text);
                XmlHelper.UpdateNodeInnerText(tenpayFilePath, @"Root/type", rblTenpayType.SelectedValue);
            }
            else if (model.api_path.ToLower().StartsWith("chinabankpc"))
            {
                //网银在线
                string chinaBankFilePath = Utils.GetMapPath(siteConfig.webpath + "xmlconfig/chinabankpc.config");
                XmlHelper.UpdateNodeInnerText(chinaBankFilePath, @"Root/partner", txtChinaBankPartner.Text);
                XmlHelper.UpdateNodeInnerText(chinaBankFilePath, @"Root/key", txtChinaBankKey.Text);
            }

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改支付方式:" + model.title); //记录日志
                result = true;
            }

            return(result);
        }
예제 #5
0
        private bool DoEdit(int _id)
        {
            bool result = true;

            BLL.payment   bll   = new BLL.payment();
            Model.payment model = bll.GetModel(_id);

            model.title           = txtTitle.Text.Trim();
            model.type            = int.Parse(rblType.SelectedValue);
            model.is_lock         = int.Parse(rblIsLock.SelectedValue);
            model.sort_id         = int.Parse(txtSortId.Text.Trim());
            model.poundage_type   = int.Parse(rblPoundageType.SelectedValue);
            model.poundage_amount = decimal.Parse(txtPoundageAmount.Text.Trim());
            //model.api_path = txtApiPath.Text.Trim();
            model.img_url = txtImgUrl.Text.Trim();
            model.remark  = txtRemark.Text;
            if (model.api_path.ToLower() == "alipay")
            {
                //支付宝
                string alipayFilePath = Utils.GetMapPath("~/xmlconfig/alipay.config");
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/partner", txtAlipayPartner.Text);
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/key", txtAlipayKey.Text);
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/seller_email", txtAlipaySellerEmail.Text);
            }
            else if (model.api_path.ToLower() == "tenpay")
            {
                //财付通
                string tenpayFilePath = Utils.GetMapPath("~/xmlconfig/tenpay.config");
                XmlHelper.UpdateNodeInnerText(tenpayFilePath, @"Root/bargainor_id", txtTenpayBargainorId.Text);
                XmlHelper.UpdateNodeInnerText(tenpayFilePath, @"Root/tenpay_key", txtTenpayKey.Text);
            }

            if (!bll.Update(model))
            {
                result = false;
            }

            return(result);
        }
예제 #6
0
        private bool DoEdit(int _id)
        {
            bool result = true;
            BLL.payment bll = new BLL.payment();
            Model.payment model = bll.GetModel(_id);

            model.title = txtTitle.Text.Trim();
            model.type = int.Parse(rblType.SelectedValue);
            model.is_lock = int.Parse(rblIsLock.SelectedValue);
            model.sort_id = int.Parse(txtSortId.Text.Trim());
            model.poundage_type = int.Parse(rblPoundageType.SelectedValue);
            model.poundage_amount = decimal.Parse(txtPoundageAmount.Text.Trim());
            //model.api_path = txtApiPath.Text.Trim();
            model.img_url = txtImgUrl.Text.Trim();
            model.remark = txtRemark.Text;
            if (model.api_path.ToLower() == "alipay")
            {
                //支付宝
                string alipayFilePath = Utils.GetMapPath("~/xmlconfig/alipay.config");
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/partner", txtAlipayPartner.Text);
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/key", txtAlipayKey.Text);
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/seller_email", txtAlipaySellerEmail.Text);
            }
            else if (model.api_path.ToLower() == "tenpay")
            {
                //财付通
                string tenpayFilePath = Utils.GetMapPath("~/xmlconfig/tenpay.config");
                XmlHelper.UpdateNodeInnerText(tenpayFilePath, @"Root/bargainor_id", txtTenpayBargainorId.Text);
                XmlHelper.UpdateNodeInnerText(tenpayFilePath, @"Root/tenpay_key", txtTenpayKey.Text);
            }

            if (!bll.Update(model))
            {
                result = false;
            }

            return result;
        }
예제 #7
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.payment bll = new BLL.payment();
            Model.payment model = bll.GetModel(_id);

            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;
            if (model.api_path.ToLower() == "alipay")
            {
                //支付宝
                string alipayFilePath = Utils.GetMapPath(siteConfig.webpath + "xmlconfig/alipay.config");
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/partner", txtAlipayPartner.Text);
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/key", txtAlipayKey.Text);
                XmlHelper.UpdateNodeInnerText(alipayFilePath, @"Root/email", txtAlipaySellerEmail.Text);
            }
            else if (model.api_path.ToLower() == "tenpay")
            {
                //财付通
                string tenpayFilePath = Utils.GetMapPath(siteConfig.webpath + "xmlconfig/tenpay.config");
                XmlHelper.UpdateNodeInnerText(tenpayFilePath, @"Root/partner", txtTenpayBargainorId.Text);
                XmlHelper.UpdateNodeInnerText(tenpayFilePath, @"Root/key", txtTenpayKey.Text);
            }
            else if (model.api_path.ToLower().StartsWith("chinabank"))
            {
                //网银在线
                string chinaBankFilePath = Utils.GetMapPath(siteConfig.webpath + "xmlconfig/chinabank.config");
                XmlHelper.UpdateNodeInnerText(chinaBankFilePath, @"Root/partner", txtChinaBankPartner.Text);
                XmlHelper.UpdateNodeInnerText(chinaBankFilePath, @"Root/key", txtChinaBankKey.Text);
            }

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改支付方式:" + model.title); //记录日志
                result = true;
            }

            return result;
        }
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.payment bll = new BLL.payment();
            Model.payment model = bll.GetModel(_id);

            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;
            int payid = MyCommFun.Str2Int(hidPayId.Value);
            if (model.pTypeId==2)
            {
                //支付宝

                Model.wx_payment_alipay alipay = aliBll.GetModel(payid);
                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();
                aliBll.Update(alipay);

                
            }
            else if (model.pTypeId==3)
            {
                //微支付
                Model.wx_payment_wxpay wxpay = wxBll.GetModel(payid);
                wxpay.paySignKey = txtpaySignKey.Text.Trim();
                wxpay.partnerId = txtTenpayPartnerId.Text.Trim();
                wxpay.partnerKey = txtTenpayKey.Text.Trim();
                wxpay.quicklyFH = rblQuicklyFH.SelectedItem.Value == "1" ? true : false;
                wxpay.appId = txtAppId.Text.Trim();
                wxBll.Update(wxpay);
                
            }
           

            if (bll.Update(model))
            {
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改支付方式:" + model.title); //记录日志
                result = true;
            }

            return result;
        }