/// <summary> /// 充值信息记录到数据库 /// </summary> /// <param name="model"></param> /// <returns>返回成功与否</returns> public int AddBMOrder(BMOrder model) { SqlParameter[] para = { new SqlParameter("@ourterTid", model.OurterTid), new SqlParameter("@orderTime", model.OrderTime), new SqlParameter("@operateTime", model.OperateTime), new SqlParameter("@Number", model.Number), new SqlParameter("@rechargeAccount", model.RechargeAccount), new SqlParameter("@itemName", model.ItemName), new SqlParameter("@itemNum", model.ItemNum), new SqlParameter("@saleAmount", model.SaleAmount), new SqlParameter("@EPmny", model.EPmny), new SqlParameter("@hl", model.Hl), new SqlParameter("@billId", model.BillId), new SqlParameter("@revokeMessage", model.RevokeMessage), new SqlParameter("@rechargeState", model.RechargeState), new SqlParameter("@OuterType", model.OuterType) }; return(DBHelper.ExecuteNonQuery("AddBMOrder", para, CommandType.StoredProcedure)); }
public void chongzhi() { DataTable dt_one = DAL.DBHelper.ExecuteDataTable("select MobileTele,TotalRemittances-TotalDefray as xf from memberinfo where Number='" + Session["Member"].ToString() + "'"); if (dt_one.Rows.Count > 0) { string ipn = dt_one.Rows[0]["MobileTele"].ToString(); decimal xf = Convert.ToDecimal(dt_one.Rows[0]["xf"].ToString()); if (xf < Convert.ToDecimal(czje.SelectedValue)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#tiaoz').show();document.getElementById('tiaoz').href = '../MemberMobile/MemberCZXF.aspx'; alertt('" + GetTran("000000", "账户金额不足,请先充值!") + "');</script>", false); } else { if (jykxm.Text == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("010492", "加油卡完整姓名不能为空!") + "')</script>", false); } if (sjh.Text == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("010493", "手机号不能为空!") + "')</script>", false); } IOpenClient client = new DefaultOpenClient(BMEshenghuo.serverUrl, BMEshenghuo.appKey, BMEshenghuo.appSecret); BmGasCardPayBillRequest req = new BmGasCardPayBillRequest(); req.ItemId = czje.SelectedValue; //商品号 req.GasCardTel = sjh.Text; //手机号 req.GasCardName = jykxm.Text; //持卡人完整姓名 req.OuterTid = "YCZ" + Model.Other.MYDateTime.ToYYMMDDHHmmssString(); req.Province = GetTran("010494", "全国"); //req.RechargeAmount = hth.Text; BmGasCardPayBillResponse response = client.Execute(req, BMEshenghuo.accessToken); BMOrder bo = new BMOrder(); if (!response.IsError) { bo.OurterTid = response.OrderDetailInfo.OuterTid; bo.OrderTime = DateTime.Now; bo.OperateTime = DateTime.Now; bo.Number = Session["Member"].ToString(); bo.RechargeAccount = response.OrderDetailInfo.RechargeAccount; bo.ItemName = response.OrderDetailInfo.ItemName; bo.ItemNum = response.OrderDetailInfo.ItemNum; bo.SaleAmount = Convert.ToDecimal(response.OrderDetailInfo.SaleAmount); bo.EPmny = Convert.ToDecimal(response.OrderDetailInfo.SaleAmount) / Common.GetnowPrice() / 7 * 4; bo.Hl = 4; bo.BillId = response.OrderDetailInfo.BillId; bo.RevokeMessage = ""; bo.RechargeState = Convert.ToInt32(response.OrderDetailInfo.RechargeState); bo.OuterType = 2; BMOrderBLL bob = new BMOrderBLL(); int abo = bob.AddBMOrder(bo); if (abo == 1) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "账户金额不足!") + "')</script>", false); } else { //DAL.CommonDataDAL.EncryptionAccount(1, Session["Member"].ToString(), "E生活操作", "", CommonDataBLL.OperateIP); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#tiaoz').show();document.getElementById('tiaoz').href = '../MemberMobile/First.aspx'; alertt('" + GetTran("010487", "订单已支付,请稍后查询!") + "');</script>", false); } } } } }
public void chongzhi() { DataTable dt_one = DAL.DBHelper.ExecuteDataTable("select MobileTele,TotalRemittances-TotalDefray as xf from memberinfo where Number='" + Session["Member"].ToString() + "'"); if (dt_one.Rows.Count > 0) { string ipn = dt_one.Rows[0]["MobileTele"].ToString(); decimal xf = Convert.ToDecimal(dt_one.Rows[0]["xf"].ToString()); if (xf < Convert.ToDecimal(ysje.Text) / Common.GetnowPrice() / 7 * 4) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#tiaoz').show();document.getElementById('tiaoz').href = '../MemberMobile/MemberCZXF.aspx'; alertt('" + GetTran("000000", "账户金额不足,请先充值!") + "');</script>", false); return; } else { DataTable dt = DAL.DBHelper.ExecuteDataTable("select isnull(sum(saleAmount),0) as saleAmount from BMOuter where OuterType=2 and Number='" + Session["Member"].ToString() + "' and convert(varchar(6),ordertime,112)=convert(varchar(6),getdate(),112)"); if (dt.Rows.Count > 0) { double saleAmount = Convert.ToDouble(dt.Rows[0]["saleAmount"].ToString()); if (saleAmount > 100) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "因目前民生系统刚开放,水电煤每个账户每月只能充值100元") + "');window.location.href='First.aspx';</script>", false); return; } if (Convert.ToInt32(ysje.Text) + saleAmount > 100) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "因目前民生系统刚开放,水电煤每个账户每月只能充值100元") + "');window.location.href='First.aspx';</script>", false); return; } if (Convert.ToInt32(ysje.Text) > 100) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "因目前民生系统刚开放,水电煤每个账户每月只能充值100元") + "');window.location.href='First.aspx';</script>", false); return; } } if (jfzh.Text == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("010519", "缴费账户不能为空!") + "')</script>", false); } if (ysje.Text == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("010520", "原始金额不能为空!") + "')</script>", false); } IOpenClient client = new DefaultOpenClient(BMEshenghuo.serverUrl, BMEshenghuo.appKey, BMEshenghuo.appSecret); BmDirectRechargeLifeRechargePayBillRequest req = new BmDirectRechargeLifeRechargePayBillRequest(); req.ItemId = lb.SelectedValue; //商品号 req.ItemNum = ysje.Text; //充值金额 req.OuterTid = "SCZ" + Model.Other.MYDateTime.ToYYMMDDHHmmssString(); req.RechargeAccount = jfzh.Text; req.ContractNo = hth.Text; BmDirectRechargeLifeRechargePayBillResponse response = client.Execute(req, BMEshenghuo.accessToken); BMOrder bo = new BMOrder(); if (!response.IsError) { bo.OurterTid = response.OrderDetailInfo.OuterTid; bo.OrderTime = DateTime.Now; bo.OperateTime = DateTime.Now; bo.Number = Session["Member"].ToString(); bo.RechargeAccount = response.OrderDetailInfo.RechargeAccount; bo.ItemName = response.OrderDetailInfo.ItemName; bo.ItemNum = response.OrderDetailInfo.ItemNum; bo.SaleAmount = Convert.ToDecimal(response.OrderDetailInfo.SaleAmount); bo.EPmny = Convert.ToDecimal(response.OrderDetailInfo.SaleAmount) / Common.GetnowPrice() / 7 * 4; bo.Hl = 4; bo.BillId = response.OrderDetailInfo.BillId; bo.RevokeMessage = ""; bo.RechargeState = Convert.ToInt32(response.OrderDetailInfo.RechargeState); bo.OuterType = 2; BMOrderBLL bob = new BMOrderBLL(); int abo = bob.AddBMOrder(bo); if (abo == 1) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "账户金额不足!") + "')</script>", false); return; } else { //DAL.CommonDataDAL.EncryptionAccount(1, Session["Member"].ToString(), "E生活操作", "", CommonDataBLL.OperateIP); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#tiaoz').show();document.getElementById('tiaoz').href = '../MemberMobile/First.aspx'; alertt('" + GetTran("010487", "订单已支付,请稍后查询!") + "');</script>", false); } } } } }
/// <summary> /// 充值信息记录到数据库 /// </summary> /// <returns></returns> public int AddBMOrder(BMOrder model) { return(aod.AddBMOrder(model)); }