public void DataBindS() { List <Hi.Model.PAY_Withdrawals> Lwithdrawals = new Hi.BLL.PAY_Withdrawals().GetList("", " isnull(dr,0)=0 and DisID=" + this.DisID, ""); if (Lwithdrawals.Count > 0) { lblState.InnerHtml = Lwithdrawals[0].State == (int)Enums.Pay_OpenState.成功 ? Enum.GetName(typeof(Enums.Pay_OpenState), Lwithdrawals[0].State) : "<i style='color:red;'>失败</i>"; object Accname; if ((Accname = Common.GetOpenAccountValue(Lwithdrawals[0].OpenAccID, "AccNumver")) != null) { lblAccNumver.InnerText = Accname.ToString(); } string ProName = string.Empty; string CityName = string.Empty; List <Hi.Model.BF_ZD_PROVINCE> BPro = new Hi.BLL.BF_ZD_PROVINCE().GetList("", " PROVCODE='" + Lwithdrawals[0].PrcCd + "'", ""); List <Hi.Model.BF_ZD_CITY> BCity = new Hi.BLL.BF_ZD_CITY().GetList("", " CITYCODE='" + Lwithdrawals[0].CityCd + "'", ""); lblAccNo.InnerText = Lwithdrawals[0].AccNo; lblAccNm.InnerText = Lwithdrawals[0].AccNm; lblAccTp.InnerText = Enum.GetName(typeof(Enums.Pay_AccTp), Lwithdrawals[0].AccTp); lblCrsMk.InnerText = Enum.GetName(typeof(Enums.Pay_CrsMk), Lwithdrawals[0].CrsMk); lblOpenBkCd.InnerText = Lwithdrawals[0].OpenBkCd; lblPrcCd.InnerText = BPro.Count > 0 ? BPro[0].PROVNAME : ""; lblCityCd.InnerText = BCity.Count > 0 ? BCity[0].CITYNAME : ""; lblOpenBkNm.InnerText = Lwithdrawals[0].OpenBkNm; lblOpenBkAddr.InnerText = Lwithdrawals[0].OpenBkAddr; lblCcyCd.InnerText = Lwithdrawals[0].CcyCd; } else { Response.Redirect("SettlementAdd.aspx", true); } }
protected void Page_Load(object sender, EventArgs e) { if (ConfigurationManager.AppSettings["IsFinancing"] != "1") { Response.Redirect("../NoOperable.aspx", true); Response.End(); } //user = LoginModel.IsLogined(this); lblMsg.Visible = false; if (!IsPostBack) { string action = Request.Form["action"]; string Pcode = Request.Form["Pcode"]; if (action == "GetCity" && !string.IsNullOrEmpty(Pcode)) { GetCityValue(Pcode); } Common.BindPro(selePrcCd, "请选择"); List <Hi.Model.PAY_Withdrawals> withdrawals = new Hi.BLL.PAY_Withdrawals().GetList("", "dr=0 and DisID=" + this.DisID, ""); if (withdrawals.Count > 0) { btnupdate.InnerText = "确定修改"; txtAccNo.Value = withdrawals[0].AccNo; lblAccNm.InnerText = withdrawals[0].AccNm; seleAccTp.Value = withdrawals[0].AccTp.ToString(); seleCrsMk.Value = withdrawals[0].CrsMk.ToString(); if (selePrcCd.Items.FindByValue(withdrawals[0].PrcCd.ToString()) != null) { selePrcCd.Value = withdrawals[0].PrcCd.ToString(); hdCityCd.Value = withdrawals[0].CityCd.ToString(); CityCode = hdCityCd.Value; } Boxbank.BankId = withdrawals[0].OpenBkCd; txtBkAddr.Value = withdrawals[0].OpenBkAddr; txtBkNm.Value = withdrawals[0].OpenBkNm; } else { List <Hi.Model.PAY_OpenAccount> openAcc = new Hi.BLL.PAY_OpenAccount().GetList("", " isnull(dr,0)=0 and state=1 and DisID=" + this.DisID, ""); if (openAcc.Count > 0) { lblAccNm.InnerText = openAcc[0].AccName; } } } }
protected void Btn_Save(object sender, EventArgs e) { List <Hi.Model.PAY_OpenAccount> openAcc = new Hi.BLL.PAY_OpenAccount().GetList("", " isnull(dr,0)=0 and state=1 and DisID=" + this.DisID, ""); if (openAcc.Count == 0) { lblMsg.InnerText = "请先添加开销户信息"; return; } if (openAcc[0].State != 1) { lblMsg.InnerText = "请成功开销户后再绑定结算账户"; return; } List <Hi.Model.PAY_Withdrawals> Lwithdrawals = new Hi.BLL.PAY_Withdrawals().GetList("", " isnull(dr,0)=0 and DisID=" + this.DisID, ""); BLL.Service.WithdrawalsParame WWP = new BLL.Service.WithdrawalsParame(); IPubnetwk IPT = new IPubnetwk(); IPT.Timeout = 2500; if (Lwithdrawals.Count > 0) { try { Lwithdrawals[0].AccNo = txtAccNo.Value.Trim(); Lwithdrawals[0].AccTp = seleAccTp.Value.ToInt(0); Lwithdrawals[0].CrsMk = seleCrsMk.Value.ToInt(0); Lwithdrawals[0].OpenBkCd = Boxbank.BankId; Lwithdrawals[0].PrcCd = selePrcCd.Value.ToInt(0); Lwithdrawals[0].CityCd = hdCityCd.Value.ToInt(0); Lwithdrawals[0].OpenBkNm = txtBkNm.Value.Trim(); Lwithdrawals[0].OpenBkAddr = txtBkAddr.Value.Trim(); Lwithdrawals[0].ts = DateTime.Now; Lwithdrawals[0].modifyuser = this.UserID; //结算账户接口参数赋值 WWP.msghd_trdt = DateTime.Now.ToString("yyyyMMdd"); WWP.srl_ptnsrl = Common.Number_repeat("1"); Lwithdrawals[0].vdef1 = WWP.srl_ptnsrl; WWP.cltacc_cltno = openAcc[0].AccNumver; WWP.cltacc_cltnm = openAcc[0].AccName; WWP.bkacc_accno = Lwithdrawals[0].AccNo; WWP.bkacc_accnm = Lwithdrawals[0].AccNm; WWP.bkacc_acctp = Lwithdrawals[0].AccTp.ToString(); WWP.bkacc_crsmk = Lwithdrawals[0].CrsMk.ToString(); WWP.bkacc_openbkcd = Lwithdrawals[0].OpenBkCd; WWP.bkacc_openbknm = Lwithdrawals[0].OpenBkNm; WWP.bkacc_prccd = Lwithdrawals[0].PrcCd.ToString(); WWP.bkacc_citycd = Lwithdrawals[0].CityCd.ToString(); WWP.bkacc_openbkaddr = Lwithdrawals[0].OpenBkAddr; if (Lwithdrawals[0].State != 1) { WWP.fcflg = "1"; } else { WWP.fcflg = "2"; } string Result = IPT.trd12000(new JavaScriptSerializer().Serialize(WWP)); JsonData jData = null; try { jData = JsonMapper.ToObject(Result); } catch { throw new Exception(Result); } if (jData != null) { if (jData["msghd_rspcode"].ToString() == "000000") { Lwithdrawals[0].State = 1; if (new Hi.BLL.PAY_Withdrawals().Update(Lwithdrawals[0])) { Response.Redirect("SettlementInfo.aspx", true); } } else { lblMsg.InnerText = "结算账户修改失败," + jData["msghd_rspmsg"].ToString() + ""; lblMsg.Visible = true; } } } catch (Exception ex) { lblMsg.InnerText = "结算账户修改失败," + ex.Message + ""; lblMsg.Visible = true; } } else { try { Hi.Model.PAY_Withdrawals withdrawals = new Hi.Model.PAY_Withdrawals(); withdrawals.DisID = this.DisID; withdrawals.CompID = this.CompID; withdrawals.State = 2; withdrawals.OpenAccID = openAcc[0].ID; withdrawals.AccNo = txtAccNo.Value.Trim(); withdrawals.AccNm = openAcc[0].AccName; withdrawals.AccTp = seleAccTp.Value.ToInt(0); withdrawals.CrsMk = seleCrsMk.Value.ToInt(0); withdrawals.OpenBkCd = Boxbank.BankId; withdrawals.PrcCd = selePrcCd.Value.ToInt(0); withdrawals.CityCd = hdCityCd.Value.ToInt(0); withdrawals.OpenBkNm = txtBkNm.Value.Trim(); withdrawals.OpenBkAddr = txtBkAddr.Value.Trim(); withdrawals.ts = DateTime.Now; withdrawals.modifyuser = this.UserID; //结算账户接口参数赋值 WWP.msghd_trdt = DateTime.Now.ToString("yyyyMMdd"); WWP.srl_ptnsrl = Common.Number_repeat("1"); withdrawals.vdef1 = WWP.srl_ptnsrl; WWP.cltacc_cltno = openAcc[0].AccNumver; WWP.cltacc_cltnm = openAcc[0].AccName; WWP.bkacc_accno = withdrawals.AccNo; WWP.bkacc_accnm = withdrawals.AccNm; WWP.bkacc_acctp = withdrawals.AccTp.ToString(); WWP.bkacc_crsmk = withdrawals.CrsMk.ToString(); WWP.bkacc_openbkcd = withdrawals.OpenBkCd; WWP.bkacc_openbknm = withdrawals.OpenBkNm; WWP.bkacc_prccd = withdrawals.PrcCd.ToString(); WWP.bkacc_citycd = withdrawals.CityCd.ToString(); WWP.bkacc_openbkaddr = withdrawals.OpenBkAddr; WWP.fcflg = "1"; string Result = IPT.trd12000(new JavaScriptSerializer().Serialize(WWP)); JsonData jData = null; try { jData = JsonMapper.ToObject(Result); } catch { throw new Exception(Result); } if (jData != null) { if (jData["msghd_rspcode"].ToString() == "000000") { withdrawals.State = 1; if (new Hi.BLL.PAY_Withdrawals().Add(withdrawals) != 0) { Response.Redirect("SettlementInfo.aspx", true); } } else { lblMsg.InnerText = "结算账户新增失败," + jData["msghd_rspmsg"].ToString() + ""; lblMsg.Visible = true; } } } catch (Exception ex) { lblMsg.InnerText = "结算账户新增失败," + ex.Message + ""; lblMsg.Visible = true; } } }
protected void btn_save(object sender, EventArgs e) { string guid = Common.Number_repeat("1"); Hi.Model.PAY_Financing Fin = new Hi.Model.PAY_Financing(); Fin.DisID = dis.ID; Fin.CompID = dis.CompID; Fin.State = 2; List <Hi.Model.PAY_OpenAccount> LOpen = new Hi.BLL.PAY_OpenAccount().GetList("", "DisID=" + Fin.DisID + " and State=1 and dr=0", ""); if (LOpen.Count > 0) { Fin.OpenAccID = LOpen[0].ID; } else { this.lblErr.InnerHtml = "请先添加开销账户!"; return; } Fin.OrderID = 0; Fin.AclAmt = Convert.ToDecimal(txtPrice.Value); Fin.Guid = guid; Fin.Type = 2; Fin.CcyCd = "CNY"; Fin.vdef1 = txtRemark.Value; Fin.ts = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")); Fin.modifyuser = this.UserID; List <Hi.Model.PAY_Withdrawals> Lwith = new Hi.BLL.PAY_Withdrawals().GetList("", "DisID=" + Fin.DisID + " and state=1 and isnull(dr,0)=0", ""); if (Lwith.Count == 0) { this.lblErr.InnerHtml = "请先维护结算账户!"; return; } if (Util.md5(txtPayPwd.Value.Trim()) != dis.Paypwd) { this.lblErr.InnerHtml = "支付密码错误!"; return; } int result = 0; result = new Hi.BLL.PAY_Financing().Add(Fin); if (result > 0) { String msghd_rspcode = ""; String msghd_rspmsg = ""; String Json = ""; try { IPubnetwk ipu = new IPubnetwk(); Json = ipu.trd16000("{\"msghd_trdt\":\"" + DateTime.Now.ToString("yyyyMMdd") + "\",\"srl_ptnsrl\":\"" + guid + "\",\"cltacc_cltno\":\"" + LOpen[0].AccNumver + "\",\"cltacc_cltnm\":\"" + LOpen[0].AccName + "\",\"amt_aclamt\":\"" + (int)(Convert.ToDecimal(txtPrice.Value) * 100) + "\"}"); } catch { this.lblErr.InnerHtml = "接口连接失败!"; return; } try { JsonData Params = JsonMapper.ToObject(Json); msghd_rspcode = Params["msghd_rspcode"].ToString(); msghd_rspmsg = Params["msghd_rspmsg"].ToString(); } catch { } if ("000000".Equals(msghd_rspcode)) { try { Hi.Model.PAY_Financing finaM = new Hi.BLL.PAY_Financing().GetModel(result); finaM.State = 1; finaM.ts = DateTime.Now; new Hi.BLL.PAY_Financing().Update(finaM); } catch { } Response.Redirect("FinancingDetailList.aspx"); } else { this.lblErr.InnerHtml = msghd_rspmsg; return; } } }
public void Bind() { orderModel = new Hi.BLL.DIS_Order().GetModel(KeyID); // 订单检查 if (orderModel == null) { //if (orderModel.Otype == (int)Enums.OType.推送账单) // JScript.AlertMethod(this, "无效的账单!", JScript.IconOption.错误, "function (){ location.replace('" + ("orderDzfzdList.aspx") + "'); }"); //else JScript.AlertMethod(this, "无效的订单!", JScript.IconOption.错误, "function (){ location.replace('" + ("orderPayList.aspx") + "'); }"); //this.lblPayError.InnerText = "无效的订单!"; return; } // 状态检查 if (!( ( (orderModel.Otype == (int)Enums.OType.销售订单 && (orderModel.OState == (int)Enums.OrderState.已审 || orderModel.OState == (int)Enums.OrderState.已发货 || orderModel.OState == (int)Enums.OrderState.已到货) && (orderModel.PayState == (int)Enums.PayState.未支付 || orderModel.PayState == (int)Enums.PayState.部分支付)) || (orderModel.Otype == (int)Enums.OType.推送账单 && orderModel.OState == (int)Enums.OrderState.已审 && (orderModel.PayState == (int)Enums.PayState.部分支付 || orderModel.PayState == (int)Enums.PayState.未支付)) ) && orderModel.OState != (int)Enums.OrderState.已作废)) { if (orderModel.Otype == (int)Enums.OType.推送账单) { JScript.AlertMethod(this, "账单异常,不能支付!", JScript.IconOption.错误, "function (){ location.replace('" + ("orderDzfzdList.aspx") + "'); }"); } else { JScript.AlertMethod(this, "订单异常,不能支付!", JScript.IconOption.错误, "function (){ location.replace('" + ("orderPayList.aspx") + "'); }"); } return; } // 审核状态 if (orderModel.OState < 2) { JScript.AlertMethod(this, "该订单未审核,不能支付!", JScript.IconOption.错误, "function (){ location.replace('" + ("../neworder/orderdetail.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey)) + "'); }"); return; } // 支付状态检查 if (orderModel.PayState != (int)Enums.PayState.未支付 && orderModel.PayState != (int)Enums.PayState.部分支付) { Response.Redirect("Error.aspx?type=" + Common.DesEncrypt("1", Common.EncryptKey) + "&KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey)); return; } // 开销户 List <Hi.Model.PAY_OpenAccount> LOpen = new Hi.BLL.PAY_OpenAccount().GetList("", "DisID=" + this.DisID + " and State=1 and isnull(dr,0)=0", ""); // 提现户 List <Hi.Model.PAY_Withdrawals> Lwith = new Hi.BLL.PAY_Withdrawals().GetList("", "DisID=" + this.DisID + " and state=1 and isnull(dr,0)=0", ""); if (LOpen.Count > 0 && Lwith.Count > 0) { String msghd_rspcode = ""; String msghd_rspmsg = ""; String amt_balamt = ""; String msghd_rspcode1 = ""; String msghd_rspmsg1 = ""; String credit_nousedamt = ""; String Json = ""; String Json1 = ""; try { IPubnetwk ipu = new IPubnetwk(); Json = ipu.trd13010("{\"msghd_trdt\":\"" + DateTime.Now.ToString("yyyyMMdd") + "\",\"srl_ptnsrl\":\"" + Common.Number_repeat("") + "\",\"cltacc_cltno\":\"" + LOpen[0].AccNumver + "\",\"cltacc_cltnm\":\"" + LOpen[0].AccName + "\",\"bkacc_accno\":\"" + Lwith[0].AccNm + "\",\"bkacc_accnm\":\"" + LOpen[0].AccName + "\"}"); Json1 = ipu.trd70000("{\"msghd_trdt\":\"" + DateTime.Now.ToString("yyyyMMdd") + "\",\"srl_ptnsrl\":\"" + Common.Number_repeat("") + "\",\"cltacc_cltno\":\"" + LOpen[0].AccNumver + "\",\"cltacc_cltnm\":\"" + LOpen[0].AccName + "\"}"); } catch { } try { JsonData Params = JsonMapper.ToObject(Json); msghd_rspcode = Params["msghd_rspcode"].ToString(); msghd_rspmsg = Params["msghd_rspmsg"].ToString(); amt_balamt = Params["amt_balamt"].ToString(); this.lblBalance1.InnerHtml = (Convert.ToDecimal(amt_balamt) / 100).ToString("N2"); JsonData Params1 = JsonMapper.ToObject(Json1); msghd_rspcode1 = Params1["msghd_rspcode"].ToString(); msghd_rspmsg1 = Params1["msghd_rspmsg"].ToString(); credit_nousedamt = Params1["credit_nousedamt"].ToString(); this.lblBalance3.InnerHtml = (Convert.ToDecimal(credit_nousedamt) / 100).ToString("N2"); } catch { } } // 在线融资记录 PList = new Hi.BLL.PAY_Financing().GetList("", "DisID=" + this.DisID + " and OrderID=" + KeyID + " and State=3 and isnull(dr,0)=0", ""); if (PList.Count > 0) { this.lblBalance5.InnerHtml = PList[0].AclAmt.ToString("0.00"); } decimal payPrice = orderModel.AuditAmount + orderModel.OtherAmount - orderModel.PayedAmount; this.lblOrderNO.InnerText = orderModel.ReceiptNo.Trim().ToString(); //账单支付链接 if (orderModel.Otype == 9) // 推送账单 { this.lblOrderNO.HRef = "../OrderZDInfo.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey); } else { this.lblOrderNO.HRef = "../neworder/orderdetail.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey); } this.hidOrderid.Value = KeyID.ToString(); this.lblPricePay.InnerText = payPrice.ToString("0.00"); this.hidPricePay.Value = payPrice.ToString("0.00"); this.lblPriceO.InnerText = (orderModel.AuditAmount + orderModel.OtherAmount).ToString("0.00"); if (this.txtPayOrder.Value == "") { this.txtPayOrder.Value = payPrice.ToString("0.00"); } else { this.txtPayOrder.Value = Convert.ToDecimal(this.txtPayOrder.Value).ToString("0.00"); } this.hidUserName.Value = this.UserName; decimal sumPrice = new Hi.BLL.PAY_PrePayment().sums(orderModel.DisID, orderModel.CompID); this.lblSumPrice.InnerText = sumPrice.ToString("0.00"); this.hidSumPrice.Value = sumPrice.ToString("0.00"); string strWhere = " 1=1 "; if (this.DisID != 0) { strWhere += " and DisID = " + this.DisID; } strWhere += " and Start = 1 and vdef6 = 0 and isnull(dr,0)=0"; List <Hi.Model.PAY_FastPayMent> fastList = new Hi.BLL.PAY_FastPayMent().GetList("", strWhere, ""); this.rptQpay.DataSource = fastList; this.rptQpay.DataBind(); List <Hi.Model.PAY_BankInfo> BankL = new Hi.BLL.PAY_BankInfo().GetList("", " vdef1=0", ""); this.rptOtherBank.DataSource = BankL; this.rptOtherBank.DataBind(); }