예제 #1
0
    protected void Bind()
    {
        if (KeyID > 0)
        {
            Hi.Model.PAY_PaymentBank bankModel = new Hi.BLL.PAY_PaymentBank().GetModel(KeyID);

            this.lblDisUser.InnerText     = bankModel.AccountName;//账户名称
            this.lblbankcode.InnerText    = bankModel.bankcode;
            this.lblbankAddress.InnerText = bankModel.bankAddress;
            this.lblprivateCity.InnerText = bankModel.bankPrivate + "/" + bankModel.bankCity + "/" + bankModel.vdef1;
            this.lblisno.InnerText        = bankModel.Isno == 1?"是":"否";
            this.lblremake.InnerText      = bankModel.Remark;
            this.lblType.InnerText        = GetType(bankModel.type);
            this.lblddlbank.InnerText     = new Hi.BLL.PAY_PrePayment().GetBankNameBYbankID(bankModel.BankID.ToString());
            this.lblstart.InnerText       = bankModel.Start == 1 ? "已复核" : "未复核";
            if (bankModel.Start == 1)
            {
                this.Edit.Attributes.Add("style", "display:none;");
            }

            //根据收款银行ID 获取关联的代理商
            DataTable dtdis = new Hi.BLL.PAY_PaymentAccountdtl().GetDisBYpbID(KeyID);
            this.gvDtl.DataSource = dtdis;
            this.gvDtl.DataBind();
        }
    }
예제 #2
0
    /// <summary>
    /// 代理商列表显示
    /// </summary>
    public void Bind()
    {
        //查询代理商
        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = string.Empty;

        if (ViewState["strwhere"] != null)
        {
            strwhere += ViewState["strwhere"].ToString();
        }
        strwhere += " and CompID=" + CompID + "   and isnull(dr,0)=0"; //IsDel=1  订单已删除
        if (this.txtPager.Value.Trim().ToString() != "")
        {
            if (this.txtPager.Value.Trim().Length >= 5)
            {
                Pager.PageSize      = 100;
                this.txtPager.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPager.Value.Trim().ToInt(0);
            }
        }


        List <Hi.Model.PAY_PaymentBank> PayAccount = new Hi.BLL.PAY_PaymentBank().GetList(Pager.PageSize, Pager.CurrentPageIndex, "CreateDate", true, strwhere, out pageCount, out Counts);

        this.rptPAcount.DataSource = PayAccount;
        this.rptPAcount.DataBind();

        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
예제 #3
0
    /// <summary>
    /// 复核
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnAudit_Click(object sender, EventArgs e)
    {
        Hi.BLL.PAY_PaymentBank   PAbll   = new Hi.BLL.PAY_PaymentBank();
        Hi.Model.PAY_PaymentBank PAmodel = PAbll.GetModel(this.KeyID);

        if (PAmodel != null)
        {
            PAmodel.Start = 1;
            bool falg = PAbll.Update(PAmodel);
            if (falg)
            {
                JScript.ShowAlert(this, "操作成功!");
                Bind();
            }
        }
    }
예제 #4
0
    //删除一行记录
    //modify  by ggh
    //
    protected void rptPAcount_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string type = e.CommandName;
        int    Id   = Convert.ToInt32(e.CommandArgument);

        if (type == "del")
        {
            Hi.BLL.PAY_PaymentBank bankBll = new Hi.BLL.PAY_PaymentBank();

            bool falg = bankBll.Delete(Id);
            if (falg)
            {
                JScript.AlertMsgOne(this, "操作成功!", JScript.IconOption.笑脸);
                Bind();
            }
        }
    }
예제 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request["KeyId"] != null)
            {
                int payid = Convert.ToInt32(Common.DesDecrypt(Request["KeyId"].ToString(), Common.EncryptKey));
                Hi.Model.PAY_Payment payment = payservice.GetModel(payid);
                if (payment != null)
                {
                    //订单编号
                    Hi.Model.DIS_Order order = new Hi.BLL.DIS_Order().GetModel(payment.OrderID);

                    if (payment.vdef4 != null)
                    {
                        lblNo.Text = payment.guid.Trim();
                    }
                    lblPayDate.Text = Convert.ToDateTime(payment.PayDate).ToString("yyyy-MM-dd HH:mm");
                    //付款方
                    Hi.Model.BD_Distributor dis = new Hi.BLL.BD_Distributor().GetModel(payment.DisID);
                    lblDisName.Text = payment.PayUser;

                    //收款方
                    Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(order.CompID);
                    lblCompName.Text = comp.CompName;
                    List <Hi.Model.PAY_PaymentBank> LBank = new Hi.BLL.PAY_PaymentBank().GetList(" top 1 accountName,bankCode ", " CompID=" + dis.CompID + " and dr=0 ", " Isno desc ");
                    if (LBank.Count > 0)
                    {
                        Hi.Model.PAY_PaymentBank bank = LBank[0];
                        lblBank2.Text = "(" + bank.AccountName + " &nbsp; " + bank.bankcode + ")";
                    }
                    //资金
                    lblPayPrice.Text   = Convert.ToDecimal(payment.PayPrice).ToString("N");
                    lblPayPriceDX.Text = CmycurD(payment.PayPrice);
                    if (!string.IsNullOrEmpty(payment.vdef5))
                    {
                        lblSXFPrice.Text = Convert.ToDecimal(payment.vdef5).ToString("N");
                    }


                    lblOrderNo.Text = order.ReceiptNo;
                }
            }
        }
    }
예제 #6
0
    protected void Bind()
    {
        if (KeyID > 0)
        {
            Hi.Model.PAY_PaymentBank bankModel = new Hi.BLL.PAY_PaymentBank().GetModel(KeyID);



            this.lblDisUser.InnerText     = bankModel.AccountName;//账户名称
            this.lblbankcode.InnerText    = bankModel.bankcode;
            this.lblbankAddress.InnerText = bankModel.bankAddress;
            this.lblprivateCity.InnerText = bankModel.bankPrivate + "/" + bankModel.bankCity + "/" + bankModel.vdef1;
            this.lblisno.InnerText        = bankModel.Isno == 1 ? "是" : "否";
            this.lblremake.InnerText      = bankModel.Remark;
            this.lblType.InnerText        = GetType(bankModel.type);
            if (bankModel.type == 11)
            {
                this.tbdis.Visible          = true;
                this.lblpesontype.InnerText = GetPesonType(bankModel.vdef2);
                this.lblpesoncode.InnerText = bankModel.vdef3;
            }
            else
            {
                this.tbdis.Visible = false;
            }


            this.lblddlbank.InnerText = new Hi.BLL.PAY_PrePayment().GetBankNameBYbankID(bankModel.BankID.ToString());
            //this.lblstart.InnerText = bankModel.Start == 1 ? "已复核" : "未复核";
            //根据收款银行ID 获取关联的代理商
            DataTable dtdis = new Hi.BLL.PAY_PaymentAccountdtl().GetDisBYpbID(KeyID);
            this.Rpt_User.DataSource = dtdis;
            this.Rpt_User.DataBind();

            int num = dtdis.Rows.Count;
            if (num == 0)
            {
                div_view.Visible = false;
            }
        }
    }
예제 #7
0
    /// <summary>
    /// 绑定信息
    /// </summary>
    public void bind()
    {
        List <Hi.Model.PAY_PaymentBank> paymentbanklist = new Hi.BLL.PAY_PaymentBank().GetList("", "  CompID=" + this.CompID, "");

        if (paymentbanklist.Count > 0)
        {
            Hi.Model.PAY_PaymentBank paymentbankmodel = paymentbanklist[0];
            bankid = paymentbankmodel.ID.ToString();

            this.txtDisUser.Value = paymentbankmodel.AccountName;//账户名称
            this.txtDisUser.Attributes.Add("class", "box noBox");
            this.txtDisUser.Attributes.Add("disabled", "true");

            this.txtbankcode.Value = paymentbankmodel.bankcode;//账户号码
            this.txtbankcode.Attributes.Add("class", "box noBox");
            this.txtbankcode.Attributes.Add("disabled", "true");

            this.txtbankAddress.Value = paymentbankmodel.bankAddress;//开户行地址
            this.txtbankAddress.Attributes.Add("class", "box noBox");
            this.txtbankAddress.Attributes.Add("disabled", "true");


            this.hidProvince.Value = paymentbankmodel.bankPrivate;//省
            this.ddlProvince.Attributes.Add("class", "prov select1 l xz2 noBox");
            this.ddlProvince.Attributes.Add("disabled", "true");

            this.hidCity.Value = paymentbankmodel.bankCity;//市
            this.ddlCity.Attributes.Add("class", "city select xz2 noBox");
            this.ddlCity.Attributes.Add("disabled", "true");

            this.hidArea.Value = paymentbankmodel.vdef1;//区
            this.ddlArea.Attributes.Add("class", "dist select  xz2 noBox");
            this.ddlArea.Attributes.Add("disabled", "true");

            this.chkIsno.Checked = paymentbankmodel.Isno == 1 ? true : false;//是否启用
            this.chkIsno.Attributes.Add("class", "fx noBox");
            this.chkIsno.Attributes.Add("disabled", "true");

            //如果在下拉列表中不存在的银行id,重新到银行表中查询加载
            ListItem list = ddlbank.Items.FindByValue(paymentbankmodel.BankID.ToString());
            if (list == null)
            {
                DataTable dt = new Hi.BLL.PAY_PrePayment().GetDate("BankCode ,BankName", "PAY_BankInfo", "BankCode=" + paymentbankmodel.BankID);
                if (dt.Rows.Count > 0)
                {
                    this.ddlbank.Items.Insert(0, new ListItem(Convert.ToString(dt.Rows[0]["BankName"]), Convert.ToString(dt.Rows[0]["BankCode"])));
                    this.ddlbank.SelectedIndex = 0;
                }
            }
            else
            {
                this.ddlbank.Value = paymentbankmodel.BankID.ToString();//银行Id

                DataTable dt = new Hi.BLL.PAY_PrePayment().GetDate("BankCode ,BankName", "PAY_BankInfo", "BankCode=" + paymentbankmodel.BankID);
                if (dt.Rows.Count > 0)
                {
                    this.ddlbank.Name = Convert.ToString(dt.Rows[0]["BankName"]);
                }
            }

            this.ddlbank.Attributes.Add("class", "xz noBox");
            this.ddlbank.Attributes.Add("disabled", "true");



            this.ddltype.Value = paymentbankmodel.type.ToString();//账户类型
            this.ddltype.Attributes.Add("class", "xz noBox");
            this.ddltype.Attributes.Add("disabled", "true");
            if (paymentbankmodel.type == 12)
            {
                this.tbdis.Attributes.Add("style", "display:none;");
            }

            this.SltPesontype.Value = paymentbankmodel.vdef2;//证件类型
            this.SltPesontype.Attributes.Add("class", "xz noBox");
            this.SltPesontype.Attributes.Add("disabled", "true");

            this.txtpesoncode.Value = paymentbankmodel.vdef3;//证件号码
            this.txtpesoncode.Attributes.Add("class", "box noBox");
            this.txtpesoncode.Attributes.Add("disabled", "true");


            //微信、支付宝不可编辑,需点击修改按钮
            Wx_ali_Disable();


            this.btnSave.Attributes.Add("style", "display:none;");
        }
        else
        {
            this.txtDisUser.Value     = "";    //账户名称
            this.txtbankcode.Value    = "";    //账户号码
            this.txtbankAddress.Value = "";    //开户行地址
            this.hidProvince.Value    = "";    //省
            this.hidCity.Value        = "";    //市
            this.hidArea.Value        = "";    //区
            this.chkIsno.Checked      = false; //是否启用
            this.ddlbank.Value        = "";    //银行Id
            this.ddltype.Value        = "";    //账户类型
            this.SltPesontype.Value   = "";    //证件类型
            this.txtpesoncode.Value   = "";    //证件号码

            this.btnUpdate.Attributes.Add("style", "display:none;");
            this.btnSave.Attributes.Add("style", "display:block;");
        }


        //查询该企业的设置
        List <Hi.Model.Pay_PayWxandAli> Sysl = new Hi.BLL.Pay_PayWxandAli().GetList("", " CompID=" + this.CompID, "");

        if (Sysl.Count > 0)
        {
            wx_aliId = Sysl[0].ID.ToString();
            //微信
            if (Sysl[0].wx_Isno == "1")
            {
                this.wx_chisno.Checked = true;
            }
            this.wx_chisno.Attributes.Add("class", "fx noBox");
            this.wx_chisno.Attributes.Add("disabled", "true");

            this.appid.Value = Convert.ToString(Sysl[0].wx_appid);
            this.appid.Attributes.Add("class", "box noBox");
            this.appid.Attributes.Add("disabled", "true");

            this.appsecret.Value = Convert.ToString(Sysl[0].wx_appsechet);
            this.appsecret.Attributes.Add("class", "box noBox");
            this.appsecret.Attributes.Add("disabled", "true");

            this.mchid.Value = Convert.ToString(Sysl[0].wx_mchid);
            this.mchid.Attributes.Add("class", "box noBox");
            this.mchid.Attributes.Add("disabled", "true");

            this.key.Value = Convert.ToString(Sysl[0].wx_key);
            this.key.Attributes.Add("class", "box noBox");
            this.key.Attributes.Add("disabled", "true");


            //支付宝
            if (Sysl[0].ali_isno == "1")
            {
                this.ali_chisno.Checked = true;
            }
            this.ali_chisno.Attributes.Add("class", "fx noBox");
            this.ali_chisno.Attributes.Add("disabled", "true");

            this.seller_email.Value = Convert.ToString(Sysl[0].ali_seller_email);
            this.seller_email.Attributes.Add("class", "box noBox");
            this.seller_email.Attributes.Add("disabled", "true");

            this.partner.Value = Convert.ToString(Sysl[0].ali_partner);
            this.partner.Attributes.Add("class", "box noBox");
            this.partner.Attributes.Add("disabled", "true");

            this.PayKey.Value = Convert.ToString(Sysl[0].ali_key);
            this.PayKey.Attributes.Add("class", "box noBox");
            this.PayKey.Attributes.Add("disabled", "true");
            this.alirsa.Value = Convert.ToString(Sysl[0].ali_RSAkey);
            this.alirsa.Attributes.Add("class", "box noBox");
            this.alirsa.Attributes.Add("disabled", "true");
            //收款帐号不可编辑,需点击修改按钮
            Paymentbank_disable();

            this.btnUpdate.Attributes.Add("style", "display:block;");
        }
        else //默认值显示
        {
            //微信
            this.appid.Value     = "";
            this.appsecret.Value = "";
            this.mchid.Value     = "";
            this.key.Value       = "";
            //支付宝
            this.seller_email.Value = "";
            this.partner.Value      = "";
            this.PayKey.Value       = "";
        }
    }
예제 #8
0
    /// <summary>
    /// 保存方法操作
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click()
    {
        string bind = string.Empty;
        //声明变量
        string AccountName = string.Empty;
        string bankcode    = string.Empty;
        string bankAddress = string.Empty;
        string bankPrivate = string.Empty;
        string bankCity    = string.Empty;
        int    Isno        = 0;
        string county      = string.Empty; //开户所在区县
        int    BankId      = 0;            //银行Id
        int    type        = 0;            //账户类型

        try
        {
            //收集数据
            AccountName = Common.NoHTML(Convert.ToString(Request["txtDisUser"]));           //账户名称
            bankcode    = Common.NoHTML(Convert.ToString(Request["txtbankcode"]));          //账户号码
            bankAddress = Common.NoHTML(Convert.ToString(Request["txtbankAddress"]));       //开户行地址
            bankPrivate = Common.NoHTML(Convert.ToString(Request["hidProvince"]));          //省
            bankCity    = Common.NoHTML(Convert.ToString(Request["hidCity"]));              //市
            county      = Common.NoHTML(Convert.ToString(Request["hidArea"]));              //区
            Isno        = Convert.ToInt32(Request["chkIsno"]);                              //是否启用
            BankId      = Convert.ToInt32(Request["ddlbank"]);                              //银行Id
            type        = Convert.ToInt32(Request["ddltype"]);                              //账户类型

            string SltPesontype = Convert.ToString(Request["SltPesontype"]);                //证件类型
            string txtpesoncode = Common.NoHTML(Convert.ToString(Request["txtpesoncode"])); //证件号码

            //查询收款帐号设置
            List <Hi.Model.PAY_PaymentBank> pbModellist = new Hi.BLL.PAY_PaymentBank().GetList("", " CompID=" + this.CompID, "");

            if (pbModellist.Count > 0)
            {
                Hi.Model.PAY_PaymentBank pbModel = pbModellist[0];
                pbModel.BankID      = BankId;
                pbModel.AccountName = AccountName;
                pbModel.bankcode    = bankcode;
                pbModel.bankAddress = bankAddress;
                pbModel.bankPrivate = bankPrivate;
                pbModel.bankCity    = bankCity;
                pbModel.Isno        = Isno;
                pbModel.modifyuser  = UserID;
                pbModel.ts          = DateTime.Now;
                pbModel.vdef1       = county;
                pbModel.type        = type;
                pbModel.vdef2       = SltPesontype;
                pbModel.vdef3       = txtpesoncode;

                bool result = new Hi.BLL.PAY_PaymentBank().Update(pbModel);
                if (result)
                {
                    string strmessage = string.Format("帐号类型:{0};户名:{1};开户行:{2};帐号:{3};开户所在省市:{4}/{5};开户地址:{6}", type, AccountName, BankId, bankcode, bankPrivate, bankCity, bankAddress);
                    Utils.AddSysBusinessLog(CompID, "paymentbank", pbModel.ID.ToString(), "收款账户修改", strmessage, this.UserID.ToString());
                }
            }
            else
            {
                //实例化对象实体
                Hi.Model.PAY_PaymentBank pbModel = new Hi.Model.PAY_PaymentBank();
                pbModel.paymentAccountID = 0;
                pbModel.BankID           = BankId;
                pbModel.AccountName      = AccountName;
                pbModel.bankcode         = bankcode;
                pbModel.bankAddress      = bankAddress;
                pbModel.bankPrivate      = bankPrivate;
                pbModel.bankCity         = bankCity;
                pbModel.Isno             = Isno;
                pbModel.CreateDate       = DateTime.Now;
                pbModel.CreateUser       = UserID;
                pbModel.dr         = 0;
                pbModel.modifyuser = UserID;
                pbModel.ts         = DateTime.Now;
                pbModel.vdef1      = county;
                pbModel.Start      = 1;
                pbModel.CompID     = CompID;
                pbModel.type       = type;
                pbModel.vdef2      = SltPesontype;
                pbModel.vdef3      = txtpesoncode;

                int succes = new Hi.BLL.PAY_PaymentBank().Add(pbModel);
                if (succes > 0)
                {
                    string strmessage = string.Format("帐号类型:{0};户名:{1};开户行:{2};帐号:{3};开户所在省市:{4}/{5};开户地址:{6}", type, AccountName, BankId, bankcode, bankPrivate, bankCity, bankAddress);
                    Utils.AddSysBusinessLog(CompID, "paymentbank", succes.ToString(), "收款账户新增", strmessage, this.UserID.ToString());
                }
            }

            #region  微信、支付宝 -支付

            //微信
            string wx_chkisno = Common.NoHTML(Convert.ToString(Request["wx_chisno"]));
            string appid      = Common.NoHTML(Convert.ToString(Request["appid"]));
            string appsecret  = Common.NoHTML(Convert.ToString(Request["appsecret"]));
            string mchid      = Common.NoHTML(Convert.ToString(Request["mchid"]));
            string key        = Common.NoHTML(Convert.ToString(Request["key"]));

            //支付宝
            string ali_chkisno  = Common.NoHTML(Convert.ToString(Request["ali_chkisno"]));
            string seller_email = Common.NoHTML(Convert.ToString(Request["seller_email"]));
            string partner      = Common.NoHTML(Convert.ToString(Request["partner"]));
            string PayKey       = Common.NoHTML(Convert.ToString(Request["PayKey"]));
            string alirsa       = Common.NoHTML(Convert.ToString(Request["alirsa"]));

            bool fal = false;

            //查询该企业的设置
            List <Hi.Model.Pay_PayWxandAli> Sysl = new Hi.BLL.Pay_PayWxandAli().GetList("", " CompID=" + this.CompID, "");

            //判断企业的是否有设置
            if (Sysl.Count > 0)
            {
                Hi.Model.Pay_PayWxandAli paywxandaliModel = Sysl[0];
                //微信
                paywxandaliModel.wx_Isno      = wx_chkisno;
                paywxandaliModel.wx_appid     = appid;
                paywxandaliModel.wx_appsechet = appsecret;
                paywxandaliModel.wx_mchid     = mchid;
                paywxandaliModel.wx_key       = key;
                //支付宝
                paywxandaliModel.ali_isno         = ali_chkisno;
                paywxandaliModel.ali_seller_email = seller_email;
                paywxandaliModel.ali_partner      = partner;
                paywxandaliModel.ali_key          = PayKey;
                paywxandaliModel.ali_RSAkey       = alirsa;

                fal = new Hi.BLL.Pay_PayWxandAli().Update(paywxandaliModel);
                if (fal)
                {
                    if (wx_chkisno.Equals("1"))
                    {
                        string strmessage = string.Format("ApppID(应用ID):{0};AppSecrect(应用秘钥):{1};Mchid(商户号):{2};APPKey(API秘钥):{3};是否启用:{4}", appid, appsecret, mchid, key, wx_chkisno);
                        Utils.AddSysBusinessLog(CompID, "paymentbank", paywxandaliModel.ID.ToString(), "微信收款账户修改", strmessage, this.UserID.ToString());
                    }
                    if (ali_chkisno.Equals("1"))
                    {
                        string strmessage = string.Format("支付宝企业账户:{0};合作者身(Partner ID):{1};安全校验码(Key):{2};RSA加密(RSA秘钥):{3};是否启用:{4}", seller_email, partner, PayKey, alirsa, ali_chkisno);
                        Utils.AddSysBusinessLog(CompID, "paymentbank", paywxandaliModel.ID.ToString(), "支付宝收款账户修改", strmessage, this.UserID.ToString());
                    }
                }
            }
            else
            {
                Hi.Model.Pay_PayWxandAli paywxandaliModel = new Hi.Model.Pay_PayWxandAli();
                //微信
                paywxandaliModel.wx_Isno      = wx_chkisno;
                paywxandaliModel.wx_appid     = appid;
                paywxandaliModel.wx_appsechet = appsecret;
                paywxandaliModel.wx_mchid     = mchid;
                paywxandaliModel.wx_key       = key;

                //支付宝
                paywxandaliModel.ali_isno         = ali_chkisno;
                paywxandaliModel.ali_seller_email = seller_email;
                paywxandaliModel.ali_partner      = partner;
                paywxandaliModel.ali_key          = PayKey;
                paywxandaliModel.ali_RSAkey       = alirsa;

                paywxandaliModel.CompID = this.CompID;
                int num = new Hi.BLL.Pay_PayWxandAli().Add(paywxandaliModel);
                if (num > 0)
                {
                    if (wx_chkisno.Equals("1"))
                    {
                        string strmessage = string.Format("ApppID(应用ID):{0};AppSecrect(应用秘钥):{1};Mchid(商户号):{2};APPKey(API秘钥):{3};是否启用:{4}", appid, appsecret, mchid, key, wx_chkisno);
                        Utils.AddSysBusinessLog(CompID, "paymentbank", paywxandaliModel.ID.ToString(), "微信收款账户新增", strmessage, this.UserID.ToString());
                    }
                    if (ali_chkisno.Equals("1"))
                    {
                        string strmessage = string.Format("支付宝企业账户:{0};合作者身(Partner ID):{1};安全校验码(Key):{2};RSA加密(RSA秘钥):{3};是否启用:{4}", seller_email, partner, PayKey, alirsa, ali_chkisno);
                        Utils.AddSysBusinessLog(CompID, "paymentbank", paywxandaliModel.ID.ToString(), "支付宝收款账户新增", strmessage, this.UserID.ToString());
                    }
                }
            }

            #endregion

            bind = "{\"ds\":\"1\",\"prompt\":\"提交成功!\"}";
        }
        catch (Exception ex)
        {
            bind = "{\"ds\":\"1\",\"prompt\":\"提交失败!\"}";
        }
        finally
        {
            Response.Write(bind);
            Response.End();
        }
    }
예제 #9
0
    protected void Bind()
    {
        string str = string.Empty;

        if (KeyID > 0)
        {
            //修改时控制账户类型是否可用
            ddltype.Disabled = false;

            Hi.Model.PAY_PaymentBank bankModel = new Hi.BLL.PAY_PaymentBank().GetModel(KeyID);

            this.txtDisUser.Value     = bankModel.AccountName;//账户名称
            this.txtbankcode.Value    = bankModel.bankcode;
            this.txtbankAddress.Value = bankModel.bankAddress;
            this.txtphone.InnerText   = bankModel.vdef4 == "" ? new Hi.BLL.PAY_PrePayment().GetPhoneBYCompID(this.CompID).ToString() : bankModel.vdef4;
            this.hid_tel.Value        = bankModel.vdef4 == "" ? new Hi.BLL.PAY_PrePayment().GetPhoneBYCompID(this.CompID).ToString() : bankModel.vdef4;

            //this.txtbankPrivate.Value = bankModel.bankPrivate;
            // this.txtbankCity.Value = bankModel.bankCity;

            this.hidProvince.Value = bankModel.bankPrivate;
            this.hidCity.Value     = bankModel.bankCity;
            this.hidArea.Value     = bankModel.vdef1;



            this.chkIsno.Checked = bankModel.Isno == 1 ? true : false;

            if (bankModel.Isno == 1)
            {
                this.btnDis.Attributes.Add("style", "display:none");
                div_grid.Attributes.Add("style", "display:none");
            }
            this.txtRemark.Value = bankModel.Remark;

            //现有银行列表
            string bankID_str = "102,103,104,105,301,100,303,305,306,302,310,309,401,403,307,308";
            string BankID     = Convert.ToString(bankModel.BankID);

            bool index = bankID_str.Contains(BankID);
            if (index)
            {
                this.ddlbank.Value = Convert.ToString(bankModel.BankID);
            }
            else
            {
                this.ddlbank.Items.Insert(0, new ListItem(new Hi.BLL.PAY_PrePayment().GetBankNameBYbankID(BankID), BankID));
                this.ddlbank.SelectedIndex = 0;
            }

            this.ddltype.Value = Convert.ToString(bankModel.type);
            if (bankModel.type == 11)
            {
                this.tbdis.Visible      = true;
                this.SltPesontype.Value = bankModel.vdef2;
                this.txtpesoncode.Value = bankModel.vdef3;
            }
            else
            {
                this.tbdis.Visible = false;
            }
            //this.ddlbank.InnerText=


            DataTable dtdis = new Hi.BLL.PAY_PaymentAccountdtl().GetDisBYpbID(KeyID);


            List <Hi.Model.BD_Distributor> dblist = new List <Hi.Model.BD_Distributor>();
            foreach (DataRow dr in dtdis.Rows)
            {
                Hi.Model.BD_Distributor dbmodel = new Hi.Model.BD_Distributor();
                dbmodel.ID        = Convert.ToInt32(dr["DisID"]);
                dbmodel.DisName   = dr["DisName"].ToString();
                dbmodel.DisCode   = dr["DisCode"].ToString();
                dbmodel.DisLevel  = dr["DisLevel"].ToString();
                dbmodel.Address   = dr["Address"].ToString();
                dbmodel.Principal = dr["Principal"].ToString();
                dbmodel.AreaID    = Convert.ToInt32(dr["AreaID"]);
                dblist.Add(dbmodel);
                //if (string.IsNullOrEmpty(str))
                //{
                //    str =dr["DisID"] + ",";
                //}
                //else
                //{
                //    str += dr["DisID"] + ",";
                //}
                //this.txtGoodsCodes.Value = new Hi.BLL.PAY_PrePayment().GetDisIDBYCompID(this.CompID) + ",";// str;
            }

            this.gvDtl.DataSource = dtdis;
            this.gvDtl.DataBind();

            AddMaterial(dblist);
        }
        else
        {
            int compid = CompID;
            this.txtphone.InnerText = new Hi.BLL.PAY_PrePayment().GetPhoneBYCompID(compid).ToString();
            this.hid_tel.Value      = new Hi.BLL.PAY_PrePayment().GetPhoneBYCompID(compid).ToString();
            //设置默认值
            ddltype.Value      = "11";
            SltPesontype.Value = "0";

            int num = new Hi.BLL.PAY_PrePayment().GetBankBYCompID(compid);
            if (num >= 1)
            {
                this.chkIsno.Checked = false;

                //this.btnDis.Attributes.Add("style", "display:block;");
                //div_grid.Attributes.Add("style", "display:block;");
                this.gvDtl.Visible  = true;
                this.btnDis.Visible = true;
            }
            else
            {
                //this.btnDis.Attributes.Add("style", "display:none;");
                //div_grid.Attributes.Add("style", "display:none;");
                this.gvDtl.Visible  = false;
                this.btnDis.Visible = false;
            }
        }
        str = new Hi.BLL.PAY_PrePayment().GetDisIDBYCompID(CompID);
        if (str != "")
        {
            this.txtGoodsCodes.Value = new Hi.BLL.PAY_PrePayment().GetDisIDBYCompID(CompID) + ",";// str;
        }
    }
예제 #10
0
    /// <summary>
    /// 银行卡绑定、关联代理商
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        //声明变量
        string AccountName = string.Empty;
        string bankcode    = string.Empty;
        string bankAddress = string.Empty;
        string bankPrivate = string.Empty;
        string bankCity    = string.Empty;
        int    Isno        = 0;
        string remark      = string.Empty;
        string county      = string.Empty; //开会所在区县
        int    BankId      = 0;            //银行Id
        int    type        = 0;            //账户类型

        //收集数据
        AccountName = this.txtDisUser.Value.Trim();//账户名称
        bankcode    = this.txtbankcode.Value.Replace(" ", "");
        bankAddress = this.txtbankAddress.Value.Trim();
        // bankPrivate = this.txtbankPrivate.Value;
        // bankCity = this.txtbankCity.Value;
        bankPrivate = this.hidProvince.Value.Trim();
        bankCity    = this.hidCity.Value.Trim();
        county      = this.hidArea.Value.Trim();
        Isno        = Convert.ToInt32(this.chkIsno.Checked == true ? 1 : 0);

        int is_no = Convert.ToInt32(this.hid_isno.Value);

        if (is_no == 1)
        {
            //Isno = 1;
            int success = new Hi.BLL.PAY_PrePayment().UpisnoBYCompID(CompID);
        }
        //else
        //{
        //    Isno = 0;
        //}
        remark = this.txtRemark.Value.Trim();
        BankId = Convert.ToInt32(this.ddlbank.Value);
        type   = Convert.ToInt32(this.ddltype.Value);

        //实例化对象实体
        Hi.Model.PAY_PaymentBank pbModel = new Hi.Model.PAY_PaymentBank();

        // Paid = Convert.ToInt32(Request.QueryString["paid"]);
        pbModel.paymentAccountID = Paid;
        pbModel.BankID           = BankId;
        pbModel.AccountName      = AccountName;
        pbModel.bankcode         = bankcode;
        pbModel.bankAddress      = bankAddress;
        pbModel.bankPrivate      = bankPrivate;
        pbModel.bankCity         = bankCity;
        pbModel.Isno             = Isno;
        pbModel.Remark           = remark;
        pbModel.CreateDate       = DateTime.Now;
        pbModel.CreateUser       = UserID;
        pbModel.dr         = 0;
        pbModel.modifyuser = UserID;
        pbModel.ts         = DateTime.Now;
        pbModel.vdef1      = county;
        pbModel.Start      = 1;

        pbModel.vdef4  = this.txtphone.InnerText;
        pbModel.vdef5  = this.txtphpcode.Value;
        pbModel.CompID = CompID;
        pbModel.type   = type;
        pbModel.vdef2  = this.SltPesontype.Value;
        pbModel.vdef3  = this.txtpesoncode.Value;
        if (KeyID > 0)
        {
            pbModel.ID = KeyID;
            bool result = new Hi.BLL.PAY_PaymentBank().Update(pbModel);

            if (result)
            {
                result = new Hi.BLL.PAY_PaymentAccountdtl().DeldtlBYpbID(KeyID);

                if (result)
                {
                    if (this.chkIsno.Checked != true)
                    {
                        #region 保存关联代理商信息


                        Hi.BLL.PAY_PaymentAccountdtl          padtlbll  = new Hi.BLL.PAY_PaymentAccountdtl();
                        List <Hi.Model.PAY_PaymentAccountdtl> padtlList = new List <Hi.Model.PAY_PaymentAccountdtl>();
                        DataTable dt = ViewState["Distributor"] as DataTable;
                        foreach (DataRow dr in dt.Rows)
                        {
                            string lblDisId = Convert.ToString(dr["ID"]);//代理商ID


                            Hi.Model.PAY_PaymentAccountdtl padtl = new Hi.Model.PAY_PaymentAccountdtl();
                            //    Label lblDisId = (Label)gvRow.FindControl("lblGoodsId");//代理商ID
                            //    Label lblDisName = (Label)gvRow.FindControl("lblDisName");
                            //    Label lblDisCode = (Label)gvRow.FindControl("lblDisCode");
                            //    Label lblAreaID = (Label)gvRow.FindControl("lblAreaID");
                            //    Label lblDisLevel = (Label)gvRow.FindControl("lblDisLevel");
                            //    Label lblAddress = (Label)gvRow.FindControl("lblAddress");
                            //    Label lblPrincipal = (Label)gvRow.FindControl("lblPrincipal");

                            padtl.DisID      = Convert.ToInt32(lblDisId); //代理商ID
                            padtl.PBID       = KeyID;                     //银行表ID
                            padtl.CreateDate = DateTime.Now;
                            padtl.CreateUser = UserID;
                            padtl.ts         = DateTime.Now;
                            padtl.dr         = 0;
                            padtl.modifyuser = UserID;
                            padtl.Start      = 0;

                            padtlList.Add(padtl);//插入到list集合中
                        }

                        padtlbll.Add(padtlList);
                        #endregion
                    }

                    //判断代理商是否有默认账户
                    int num = new Hi.BLL.PAY_PrePayment().GetBankBYCompID(CompID);

                    if (Request["nextstep"] + "" == "1")
                    {
                        if (num == 0)
                        {
                            JScript.AlertMethod(this, "一个企业,最好有一个,默认第一收款账户,请检查!", JScript.IconOption.错误, "function (){ location.href='" + ("PayBankAuditInfo.aspx?nextstep=1&paid=" + Paid + "&KeyID=" + KeyID) + "'; }");
                        }
                        else
                        {
                            Response.Redirect("PayBankAuditInfo.aspx?nextstep=1&paid=" + Paid + "&KeyID=" + KeyID);
                        }
                    }
                    else
                    {
                        if (num == 0)
                        {
                            JScript.AlertMethod(this, "一个企业,最好有一个,默认第一收款账户,请检查!", JScript.IconOption.错误, "function (){ location.href='" + ("PayBankAuditInfo.aspx?paid=" + Paid + "&KeyID=" + KeyID) + "'; }");
                        }
                        else
                        {
                            Response.Redirect("PayBankAuditInfo.aspx?paid=" + Paid + "&KeyID=" + KeyID);
                        }
                        //JScript.AlertMsg(this, "操作成功!", "PayBankAuditInfo.aspx?paid=" + Paid + "&KeyID=" + KeyID);
                    }
                }
            }
        }
        else
        {
            int succes = new Hi.BLL.PAY_PaymentBank().Add(pbModel);
            if (succes > 0)//银行账户保存成功后,进行绑定代理商操作
            {
                if (this.chkIsno.Checked != true)
                {
                    #region 保存关联代理商信息


                    Hi.BLL.PAY_PaymentAccountdtl          padtlbll  = new Hi.BLL.PAY_PaymentAccountdtl();
                    List <Hi.Model.PAY_PaymentAccountdtl> padtlList = new List <Hi.Model.PAY_PaymentAccountdtl>();
                    DataTable dt = ViewState["Distributor"] as DataTable;
                    foreach (DataRow dr in dt.Rows)
                    {
                        string lblDisId = Convert.ToString(dr["ID"]);//代理商ID
                        //Label lblDisName = (Label)gvRow.FindControl("lblDisName");
                        //Label lblDisCode = (Label)gvRow.FindControl("lblDisCode");
                        //Label lblAreaID = (Label)gvRow.FindControl("lblAreaID");
                        //Label lblDisLevel = (Label)gvRow.FindControl("lblDisLevel");
                        //Label lblAddress = (Label)gvRow.FindControl("lblAddress");
                        //Label lblPrincipal = (Label)gvRow.FindControl("lblPrincipal");

                        Hi.Model.PAY_PaymentAccountdtl padtl = new Hi.Model.PAY_PaymentAccountdtl();
                        padtl.DisID      = Convert.ToInt32(lblDisId); //代理商ID
                        padtl.PBID       = succes;                    //银行表ID
                        padtl.CreateDate = DateTime.Now;
                        padtl.CreateUser = UserID;
                        padtl.ts         = DateTime.Now;
                        padtl.dr         = 0;
                        padtl.modifyuser = UserID;
                        padtl.Start      = 0;

                        padtlList.Add(padtl);//插入到list集合中
                    }

                    padtlbll.Add(padtlList);

                    #endregion
                }
                // JScript.AlertMsg(this, "操作成功!", "PAbankInfo.aspx?paid=" + Paid + "&KeyID=" + succes);
                // ClientScript.RegisterStartupScript(this.GetType(), "add", "<script>activeName(); window.location.href ='PAbankInfo.aspx?paid=" + Paid + "&KeyID=" + succes+"';</script>");
                //判断代理商是否有默认账户
                int num = new Hi.BLL.PAY_PrePayment().GetBankBYCompID(CompID);

                if (Request["nextstep"] + "" == "1")
                {
                    if (num == 0)
                    {
                        JScript.AlertMethod(this, "一个企业,最好有一个,默认第一收款账户,请检查!", JScript.IconOption.错误, "function (){ location.href='" + ("PayBankAuditInfo.aspx?nextstep=1&paid=" + Paid + "&KeyID=" + succes) + "'; }");
                    }
                    else
                    {
                        Response.Redirect("PayBankAuditInfo.aspx?nextstep=1&paid=" + Paid + "&KeyID=" + succes);
                    }
                }
                else
                {
                    if (num == 0)
                    {
                        JScript.AlertMethod(this, "一个企业,最好有一个,默认第一收款账户,请检查!", JScript.IconOption.错误, "function (){ location.href='" + ("PayBankAuditInfo.aspx?paid=" + Paid + "&KeyID=" + succes) + "'; }");
                    }
                    else
                    {
                        Response.Redirect("PayBankAuditInfo.aspx?paid=" + Paid + "&KeyID=" + succes);
                    }
                }
            }
        }
    }
예제 #11
0
    protected void Bind()
    {
        string str = string.Empty;

        if (paid > 0)
        {
            ////修改时控制账户类型是否可用
            ddltype.Disabled = false;

            Hi.Model.PAY_PaymentBank bankModel = new Hi.BLL.PAY_PaymentBank().GetModel(paid);

            this.txtDisUser.Value     = bankModel.AccountName;//账户名称
            this.txtbankcode.Value    = bankModel.bankcode;
            this.txtbankAddress.Value = bankModel.bankAddress;
            this.hid_tel.Value        = bankModel.vdef4 == "" ? new Hi.BLL.PAY_PrePayment().GetPhoneBYCompID(bankModel.CompID).ToString() : bankModel.vdef4;

            this.hidProvince.Value = bankModel.bankPrivate;
            this.hidCity.Value     = bankModel.bankCity;
            this.hidArea.Value     = bankModel.vdef1;

            //给隐藏域赋值
            this.txtcompId.Value = bankModel.CompID.ToString();
            CompID = bankModel.CompID;

            this.chkIsno.Checked = bankModel.Isno == 1 ? true : false;

            if (bankModel.Isno == 1)
            {
                this.btnDis.Attributes.Add("style", "display:none");
                div_grid.Attributes.Add("style", "display:none");
            }
            this.txtRemark.Value = bankModel.Remark;

            //现有银行列表
            string bankID_str = "102,103,104,105,301,100,303,305,306,302,310,309,401,403,307,308";
            string BankID     = Convert.ToString(bankModel.BankID);

            bool index = bankID_str.Contains(BankID);
            if (index)
            {
                this.ddlbank.Value = Convert.ToString(bankModel.BankID);
            }
            else
            {
                this.ddlbank.Items.Insert(0, new ListItem(new Hi.BLL.PAY_PrePayment().GetBankNameBYbankID(BankID), BankID));
                this.ddlbank.SelectedIndex = 0;
            }

            this.ddltype.Value = Convert.ToString(bankModel.type);
            if (bankModel.type == 11)
            {
                this.tbdis.Visible      = true;
                this.SltPesontype.Value = bankModel.vdef2;
                this.txtpesoncode.Value = bankModel.vdef3;
            }
            else
            {
                //this.tbdis.Visible = false;
                this.tbdis.Attributes.Add("style", "display:none");
            }
        }
        else
        {
            //给隐藏域赋值  厂商ID
            this.txtcompId.Value = CompID.ToString();

            this.hid_tel.Value = new Hi.BLL.PAY_PrePayment().GetPhoneBYCompID(CompID).ToString();
            //设置默认值
            ddltype.Value      = "11";
            SltPesontype.Value = "0";

            int num = new Hi.BLL.PAY_PrePayment().GetBankBYCompID(CompID);
            if (num >= 1)
            {
                this.chkIsno.Checked = false;

                this.gvDtl.Visible  = true;
                this.btnDis.Visible = true;
            }
            else
            {
                this.gvDtl.Visible  = false;
                this.btnDis.Visible = false;
            }
        }
        str = new Hi.BLL.PAY_PrePayment().GetDisIDBYCompID(CompID);
        if (str != "")
        {
            this.txtGoodsCodes.Value = new Hi.BLL.PAY_PrePayment().GetDisIDBYCompID(CompID) + ",";// str;
        }
    }
예제 #12
0
    /// <summary>
    /// 银行卡绑定、关联代理商
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        //声明变量
        string AccountName = string.Empty;
        string bankcode    = string.Empty;
        string bankAddress = string.Empty;
        string bankPrivate = string.Empty;
        string bankCity    = string.Empty;
        int    Isno        = 0;
        string remark      = string.Empty;
        string county      = string.Empty; //开会所在区县
        int    BankId      = 0;            //银行Id
        int    type        = 0;            //账户类型

        //收集数据
        AccountName = Common.NoHTML(this.txtDisUser.Value.Trim());//账户名称
        bankcode    = Common.NoHTML(this.txtbankcode.Value.Replace(" ", ""));
        bankAddress = Common.NoHTML(this.txtbankAddress.Value.Trim());
        bankPrivate = Common.NoHTML(this.hidProvince.Value.Trim());
        bankCity    = Common.NoHTML(this.hidCity.Value.Trim());
        county      = Common.NoHTML(this.hidArea.Value.Trim());
        Isno        = Convert.ToInt32(this.chkIsno.Checked == true ? 1 : 0);

        int is_no = Convert.ToInt32(this.hid_isno.Value);

        if (is_no == 1)
        {
            int success = new Hi.BLL.PAY_PrePayment().UpisnoBYCompID(Convert.ToInt32(this.txtcompId.Value));
        }

        remark = Common.NoHTML(this.txtRemark.Value.Trim());
        BankId = Convert.ToInt32(this.ddlbank.Value);
        type   = Convert.ToInt32(this.ddltype.Value);

        //实例化对象实体
        Hi.Model.PAY_PaymentBank pbModel = new Hi.Model.PAY_PaymentBank();
        pbModel.paymentAccountID = Paid;
        pbModel.BankID           = BankId;
        pbModel.AccountName      = AccountName;
        pbModel.bankcode         = bankcode;
        pbModel.bankAddress      = bankAddress;
        pbModel.bankPrivate      = bankPrivate;
        pbModel.bankCity         = bankCity;
        pbModel.Isno             = Isno;
        pbModel.Remark           = remark;
        pbModel.CreateDate       = DateTime.Now;
        pbModel.CreateUser       = UserID;
        pbModel.dr         = 0;
        pbModel.modifyuser = UserID;
        pbModel.ts         = DateTime.Now;
        pbModel.vdef1      = county;
        pbModel.Start      = 1;
        pbModel.type       = type;
        pbModel.vdef2      = Common.NoHTML(this.SltPesontype.Value);
        pbModel.vdef3      = Common.NoHTML(this.txtpesoncode.Value);
        if (paid > 0)
        {
            pbModel.CompID = Convert.ToInt32(this.txtcompId.Value);// 厂商ID
            pbModel.ID     = paid;
            bool result = new Hi.BLL.PAY_PaymentBank().Update(pbModel);

            if (result)
            {
                Response.Redirect("PayBankAuditInfo.aspx?KeyID=" + paid);
            }
        }
        else
        {
            pbModel.CompID = Convert.ToInt32(this.txtcompId.Value);// 厂商ID

            int succes = new Hi.BLL.PAY_PaymentBank().Add(pbModel);
            if (succes > 0)//银行账户保存成功
            {
                Response.Redirect("PayBankAuditInfo.aspx?KeyID=" + succes);
            }
        }
    }