Exemple #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);
        }
Exemple #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);
        }
 private void ShowInfo(int _id)
 {
     BLL.payment bll = new BLL.payment();
     model = bll.GetModel(_id);
     txtTitle.Text = model.title;
     rblType.SelectedValue = model.type.ToString();
     rblIsLock.SelectedValue = model.is_lock.ToString();
     txtSortId.Text = model.sort_id.ToString();
     rblPoundageType.SelectedValue = model.poundage_type.ToString();
     txtPoundageAmount.Text = model.poundage_amount.ToString();
     //txtApiPath.Text = model.api_path;
     txtImgUrl.Text = model.img_url;
     txtRemark.Text = model.remark;
     if (model.api_path.ToLower() == "alipay")
     {
         //支付宝
         XmlDocument doc = XmlHelper.LoadXmlDoc(Utils.GetMapPath("~/xmlconfig/alipay.config"));
         txtAlipayPartner.Text = doc.SelectSingleNode(@"Root/partner").InnerText;
         txtAlipayKey.Text = doc.SelectSingleNode(@"Root/key").InnerText;
         txtAlipaySellerEmail.Text = doc.SelectSingleNode(@"Root/seller_email").InnerText;
     }
     else if (model.api_path.ToLower() == "tenpay")
     {
         //财付通
         XmlDocument doc1 = XmlHelper.LoadXmlDoc(Utils.GetMapPath("~/xmlconfig/tenpay.config"));
         txtTenpayBargainorId.Text = doc1.SelectSingleNode(@"Root/bargainor_id").InnerText;
         txtTenpayKey.Text = doc1.SelectSingleNode(@"Root/tenpay_key").InnerText;
     }
 }
Exemple #4
0
 private void ShowInfo(int _id)
 {
     BLL.payment bll = new BLL.payment();
     model                         = bll.GetModel(_id);
     txtTitle.Text                 = model.title;
     rblType.SelectedValue         = model.type.ToString();
     rblIsLock.SelectedValue       = model.is_lock.ToString();
     txtSortId.Text                = model.sort_id.ToString();
     rblPoundageType.SelectedValue = model.poundage_type.ToString();
     txtPoundageAmount.Text        = model.poundage_amount.ToString();
     //txtApiPath.Text = model.api_path;
     txtImgUrl.Text = model.img_url;
     txtRemark.Text = model.remark;
     if (model.api_path.ToLower() == "alipay")
     {
         //支付宝
         XmlDocument doc = XmlHelper.LoadXmlDoc(Utils.GetMapPath("~/xmlconfig/alipay.config"));
         txtAlipayPartner.Text     = doc.SelectSingleNode(@"Root/partner").InnerText;
         txtAlipayKey.Text         = doc.SelectSingleNode(@"Root/key").InnerText;
         txtAlipaySellerEmail.Text = doc.SelectSingleNode(@"Root/seller_email").InnerText;
     }
     else if (model.api_path.ToLower() == "tenpay")
     {
         //财付通
         XmlDocument doc1 = XmlHelper.LoadXmlDoc(Utils.GetMapPath("~/xmlconfig/tenpay.config"));
         txtTenpayBargainorId.Text = doc1.SelectSingleNode(@"Root/bargainor_id").InnerText;
         txtTenpayKey.Text         = doc1.SelectSingleNode(@"Root/tenpay_key").InnerText;
     }
 }
Exemple #5
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);
        }
Exemple #6
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);
        }
        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;
        }
Exemple #8
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;
        }
Exemple #9
0
 private void ShowInfo(int _id)
 {
     BLL.payment bll = new BLL.payment();
     model                 = bll.GetModel(_id);
     txtTitle.Text         = model.title;
     rblType.SelectedValue = model.type.ToString();
     rblType.Enabled       = false;
     if (model.is_lock == 0)
     {
         cbIsLock.Checked = true;
     }
     else
     {
         cbIsLock.Checked = false;
     }
     rblIsMobile.SelectedValue     = model.is_mobile.ToString();
     txtSortId.Text                = model.sort_id.ToString();
     rblPoundageType.SelectedValue = model.poundage_type.ToString();
     txtPoundageAmount.Text        = model.poundage_amount.ToString();
     txtImgUrl.Text                = model.img_url;
     txtRemark.Text                = model.remark;
     if (model.api_path.ToLower() == "alipaypc")
     {
         //支付宝
         XmlDocument doc = XmlHelper.LoadXmlDoc(Utils.GetMapPath(siteConfig.webpath + "xmlconfig/alipaypc.config"));
         txtAlipayPartner.Text       = doc.SelectSingleNode(@"Root/partner").InnerText;
         txtAlipayKey.Text           = doc.SelectSingleNode(@"Root/key").InnerText;
         txtAlipaySellerEmail.Text   = doc.SelectSingleNode(@"Root/email").InnerText;
         rblAlipayType.SelectedValue = doc.SelectSingleNode(@"Root/type").InnerText;
     }
     else if (model.api_path.ToLower() == "tenpaypc")
     {
         //财付通
         XmlDocument doc = XmlHelper.LoadXmlDoc(Utils.GetMapPath(siteConfig.webpath + "xmlconfig/tenpaypc.config"));
         txtTenpayBargainorId.Text   = doc.SelectSingleNode(@"Root/partner").InnerText;
         txtTenpayKey.Text           = doc.SelectSingleNode(@"Root/key").InnerText;
         rblTenpayType.SelectedValue = doc.SelectSingleNode(@"Root/type").InnerText;
     }
     else if (model.api_path.ToLower() == "chinabankpc")
     {
         //网银在线
         XmlDocument doc = XmlHelper.LoadXmlDoc(Utils.GetMapPath(siteConfig.webpath + "xmlconfig/chinabankpc.config"));
         txtChinaBankPartner.Text = doc.SelectSingleNode(@"Root/partner").InnerText;
         txtChinaBankKey.Text     = doc.SelectSingleNode(@"Root/key").InnerText;
     }
 }
 private void ShowInfo(int _id)
 {
     BLL.payment bll = new BLL.payment();
     model = bll.GetModel(_id);
     txtTitle.Text = model.title;
     rblType.SelectedValue = model.type.ToString();
     rblType.Enabled = false;
     if (model.is_lock == 0)
     {
         cbIsLock.Checked = true;
     }
     else
     {
         cbIsLock.Checked = false;
     }
     rblIsMobile.SelectedValue = model.is_mobile.ToString();
     txtSortId.Text = model.sort_id.ToString();
     rblPoundageType.SelectedValue = model.poundage_type.ToString();
     txtPoundageAmount.Text = model.poundage_amount.ToString();
     txtImgUrl.Text = model.img_url;
     txtRemark.Text = model.remark;
     if (model.api_path.ToLower() == "alipaypc")
     {
         //支付宝
         XmlDocument doc = XmlHelper.LoadXmlDoc(Utils.GetMapPath(siteConfig.webpath + "xmlconfig/alipaypc.config"));
         txtAlipayPartner.Text = doc.SelectSingleNode(@"Root/partner").InnerText;
         txtAlipayKey.Text = doc.SelectSingleNode(@"Root/key").InnerText;
         txtAlipaySellerEmail.Text = doc.SelectSingleNode(@"Root/email").InnerText;
         rblAlipayType.SelectedValue = doc.SelectSingleNode(@"Root/type").InnerText;
     }
     else if (model.api_path.ToLower() == "tenpaypc")
     {
         //财付通
         XmlDocument doc = XmlHelper.LoadXmlDoc(Utils.GetMapPath(siteConfig.webpath + "xmlconfig/tenpaypc.config"));
         txtTenpayBargainorId.Text = doc.SelectSingleNode(@"Root/partner").InnerText;
         txtTenpayKey.Text = doc.SelectSingleNode(@"Root/key").InnerText;
         rblTenpayType.SelectedValue = doc.SelectSingleNode(@"Root/type").InnerText;
     }
     else if (model.api_path.ToLower() == "chinabankpc")
     {
         //网银在线
         XmlDocument doc = XmlHelper.LoadXmlDoc(Utils.GetMapPath(siteConfig.webpath + "xmlconfig/chinabankpc.config"));
         txtChinaBankPartner.Text = doc.SelectSingleNode(@"Root/partner").InnerText;
         txtChinaBankKey.Text = doc.SelectSingleNode(@"Root/key").InnerText;
     }
 }
        private void ShowInfo(int _id)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();
            BLL.payment bll = new BLL.payment();
            model = bll.GetModel(_id);
            txtTitle.Text = model.title;
          
            if (model.is_lock == 0)
            {
                cbIsLock.Checked = true;
            }
            else
            {
                cbIsLock.Checked = false;
            }
            txtSortId.Text = model.sort_id.ToString();
            rblPoundageType.SelectedValue = model.poundage_type.ToString();
            txtPoundageAmount.Text = model.poundage_amount.ToString();
            txtImgUrl.Text = model.img_url;
            txtRemark.Text = model.remark;
            if (model.pTypeId==2)
            {
                //支付宝
                Model.wx_payment_alipay alipay = aliBll.GetModelList("wid=" + weixin.id)[0];
                txtAlipaySellerEmail.Text = alipay.ownerName;
                txtAlipayPartner.Text = alipay.partner;
                txtAlipayKey.Text = alipay.e_key;
                txtprivate_key.Text = alipay.private_key;
                txtpublic_key.Text = alipay.public_key;
                hidPayId.Value = alipay.id.ToString();

            }
            else if (model.pTypeId==3)
            {
                //微信支付
                Model.wx_payment_wxpay wxpay = wxBll.GetModelByWid(weixin.id);
                txtpaySignKey.Text = wxpay.paySignKey;
                txtTenpayPartnerId.Text = wxpay.partnerId;
                txtTenpayKey.Text = wxpay.partnerKey;
                hidPayId.Value = wxpay.id.ToString();
                rblQuicklyFH.SelectedValue = wxpay.quicklyFH.ToString().ToLower()=="true" ? "1" : "0";
                txtAppId.Text=wxpay.appId ;

            }
            
        }
Exemple #12
0
        private void ShowInfo(int _id)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();
            BLL.payment         bll    = new BLL.payment();
            model         = bll.GetModel(_id);
            txtTitle.Text = model.title;

            if (model.is_lock == 0)
            {
                cbIsLock.Checked = true;
            }
            else
            {
                cbIsLock.Checked = false;
            }
            txtSortId.Text = model.sort_id.ToString();
            rblPoundageType.SelectedValue = model.poundage_type.ToString();
            txtPoundageAmount.Text        = model.poundage_amount.ToString();
            txtImgUrl.Text = model.img_url;
            txtRemark.Text = model.remark;
            if (model.pTypeId == 2)
            {
                //支付宝
                Model.wx_payment_alipay alipay = aliBll.GetModelList("wid=" + weixin.id)[0];
                txtAlipaySellerEmail.Text = alipay.ownerName;
                txtAlipayPartner.Text     = alipay.partner;
                txtAlipayKey.Text         = alipay.e_key;
                txtprivate_key.Text       = alipay.private_key;
                txtpublic_key.Text        = alipay.public_key;
                hidPayId.Value            = alipay.id.ToString();
            }
            else if (model.pTypeId == 3)
            {
                //微信支付
                Model.wx_payment_wxpay wxpay = wxBll.GetModelByWid(weixin.id);
                txtpaySignKey.Text         = wxpay.paySignKey;
                txtTenpayPartnerId.Text    = wxpay.partnerId;
                txtTenpayKey.Text          = wxpay.partnerKey;
                hidPayId.Value             = wxpay.id.ToString();
                rblQuicklyFH.SelectedValue = wxpay.quicklyFH.ToString().ToLower() == "true" ? "1" : "0";
                BLL.wx_userweixin   uwBll    = new BLL.wx_userweixin();
                Model.wx_userweixin uwEneity = uwBll.GetModel(weixin.id);

                lblAppId.Text = uwEneity.AppId;
            }
        }
Exemple #13
0
        private void ShowInfo(int _id)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();
            BLL.payment         bll    = new BLL.payment();
            model         = bll.GetModel(_id);
            txtTitle.Text = model.title;

            if (model.is_lock == 0)
            {
                cbIsLock.Checked = true;
            }
            else
            {
                cbIsLock.Checked = false;
            }
            txtSortId.Text = model.sort_id.ToString();
            rblPoundageType.SelectedValue = model.poundage_type.ToString();
            txtPoundageAmount.Text        = model.poundage_amount.ToString();
            txtImgUrl.Text = model.img_url;
            txtRemark.Text = model.remark;
        }
        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;
        }
Exemple #15
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);
        }
Exemple #16
0
        private void order_pay(HttpContext context)
        {
            Model.users model = new BasePage().GetUserInfo();
            if (model == null)
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"对不起,请重新登录!\"}");
                return;
            }

            string pay_type = DTRequest.GetQueryString("pay_type");//支付类型
            int pay_ment = DTRequest.GetQueryInt("pay_ment");//支付方式
            int order_id = DTRequest.GetQueryInt("order_id");

            BLL.orders bll = new BLL.orders();
            Model.orders model_order = bll.GetModel(order_id);
            if (model_order == null)
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"订单不存在!\"}");
                return;
            }

            switch (pay_type)
            {
                case "month":
                    model_order.is_up = 3;
                    break;
                case "is_up":
                    model_order.is_up = 2;
                    break;
                case "payno":
                    model_order.is_up = 1;
                    break;
            }

            //直接支付
            BLL.payment bll_pay = new BLL.payment();
            Model.payment model_pay = new Model.payment();
            string url = "";
            if (pay_type == "payno")
            {
                model_pay = bll_pay.GetModel(pay_ment);
                if (model_pay == null)
                {
                    context.Response.Write("{\"status\":\"0\", \"msg\":\"支付方式不存在或已删除!\"}");
                    return;
                }
                model_order.payment_id = model_pay.id;
                if (model_pay.type == 1)
                {
                    //用户余额
                    if (model_pay.api_path == "balance")
                    {
                        if (model.amount < model_order.order_amount)
                        {
                            context.Response.Write("{\"status\":\"0\", \"msg\":\"对不起,您的用户余额不足请充值!\"}");
                            return;
                        }
                        decimal user_amount = model.amount - model_order.order_amount;
                        if (new BLL.users().UpdateField(model.id, "amount=" + user_amount) <= 0)
                        {
                            context.Response.Write("{\"status\":\"0\", \"msg\":\"扣除余额失败,支付失败!\"}");
                            return;
                        }
                        model_order.status = 2;
                        model_order.payment_status = 2;
                    }
                    else
                    {
                        url = siteConfig.webpath + "api/payment/" + model_pay.api_path + "/index.aspx?action=pay&pay_user_name=" + model.nick_name.Trim()
                                  + "&pay_order_type=" + DTEnums.AmountTypeEnum.BuyGoods.ToString() + "&pay_order_no=" + model_order.order_no + "&pay_order_amount=" + model_order.order_amount + "&pay_subject=商品订单";
                    }
                }
                else
                {
                    //货到付款
                }
            }

            if (!bll.Update(model_order))
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"支付方式保存失败!\"}");
                return;
            }
            else
            {
                context.Response.Write("{\"status\":\"1\", \"msg\":\"支付成功!\",\"url\":\"" + url + "\"}");
                return;
            }
        }