public ActionResult CashIMMEDIATE() { int userid = Utils.checkloginsession(); string url = Utils.GetChinapnrUrl(); decimal Amt = decimal.Parse(DNTRequest.GetString("TransAmt")); int UsrBindCardID = DNTRequest.GetInt("UsrBindCardID", 0); //string vcode = DNTRequest.GetString("vcode"); string strIdentify = "CashValidateCode"; //随机字串存储键值,以便存储到Session中 LogInfo.WriteLog("即时取现:userid=" + userid + ";url=" + url + ";Amt=" + Amt + ";UsrBindCardID=" + UsrBindCardID + ";strIdentify=" + strIdentify); decimal ServFee = 0.00M; //if (Session[strIdentify] != null) //{ // if (Session[strIdentify].ToString() != vcode) // { // return Content(StringAlert.Alert("验证码不对!"), "text/html"); // } //} //else //{ // return Content(StringAlert.Alert("验证码已过期!"), "text/html"); //} decimal servf = ServFee; ViewBag.errCode = "0"; B_member_table b = new B_member_table(); M_member_table p = new M_member_table(); p = b.GetModel(userid); if (p.available_balance < Amt) { ViewBag.errCode = "-1"; return(View(new M_Cash())); } if (Amt <= ServFee) { return(Content(StringAlert.Alert("取现金额小于或等于手续费,不能提现!"), "text/html")); } else if (p.available_balance < Amt + ServFee) { Amt = Amt - ServFee; } hx_UsrBindCardC ubc = ef.hx_UsrBindCardC.Where(g => g.UsrBindCardID == UsrBindCardID).FirstOrDefault(); if (ubc == null) { ViewBag.errCode = "-2"; return(View(new M_Cash())); } ViewBag.url = url; string FeeObjFlag = "M";//"U"; string cashChl = Enum.GetName(typeof(EnumCommon.E_hx_td_UserCash.EnumCashChl), (int)EnumCommon.E_hx_td_UserCash.EnumCashChl.IMMEDIATE); M_Cash mc = ChinapnrFacade.Cash(p.UsrCustId, Amt.ToString("0.00"), ubc.OpenAcctId, cashChl, ServFee.ToString("0.00"), FeeObjFlag); if (mc != null) { M_td_UserCash mu = new M_td_UserCash(); B_td_UserCash mo = new B_td_UserCash(); mu.registerid = p.registerid; mu.UsrCustId = p.UsrCustId; mu.TransAmt = decimal.Parse(mc.TransAmt); mu.FeeAmt = ChinapnrFacade.CalcCashFee(Amt.ToString("0.00"), cashChl, FeeObjFlag) + servf; mu.OrdId = mc.OrdId; mu.OrdIdTime = DateTime.Now; mu.OrdIdState = 0; mu.FeeObjFlag = FeeObjFlag; mu.CashChl = cashChl; mo.Add(mu); } return(View("CashQm", mc)); }
/// <summary> /// 提现提交处理方法---快速提现 /// </summary> /// <returns></returns> public ActionResult CashGENERAL() { int userid = CurrentUserId; string url = Utils.GetChinapnrUrl(); decimal Amt = decimal.Parse(DNTRequest.GetString("amt")); int UsrBindCardID = DNTRequest.GetInt("UsrBindCardID", 0); int UsrCashType = DNTRequest.GetInt("UsrCashType", 1); /* * string vcode = DNTRequest.GetString("vcode"); * string strIdentify = "CashValidateCode"; //随机字串存储键值,以便存储到Session中 * if (Session[strIdentify] != null) * { * if (Session[strIdentify].ToString() != vcode) * { * return Content(StringAlert.Alert("验证码不对!"), "text/html"); * } * } * else * { * return Content(StringAlert.Alert("验证码已过期!"), "text/html"); * }*/ ViewBag.errCode = "0"; B_member_table b = new B_member_table(); M_member_table p = new M_member_table(); p = b.GetModel(userid); if (p.available_balance < Amt) { ViewBag.errCode = "-1"; return(View(new M_Cash())); } hx_UsrBindCardC ubc = ef.hx_UsrBindCardC.Where(g => g.UsrBindCardID == UsrBindCardID).FirstOrDefault(); if (ubc == null) { ViewBag.errCode = "-2"; return(View(new M_Cash())); } ViewBag.url = url; decimal servf = 0.00M; string cashChl = Enum.GetName(typeof(EnumCommon.E_hx_td_UserCash.EnumCashChl), (int)EnumCommon.E_hx_td_UserCash.EnumCashChl.GENERAL); //string cashType = "FAST"; string FeeObjFlag = "M"; if (UsrCashType == 2) { cashChl = Enum.GetName(typeof(EnumCommon.E_hx_td_UserCash.EnumCashChl), (int)EnumCommon.E_hx_td_UserCash.EnumCashChl.IMMEDIATE); //FeeObjFlag = "U"; } //bug 修复,应该为快速提现。此前为普通提现 by fangjianmin M_Cash mc = ChinapnrFacade.Cash(p.UsrCustId, Amt.ToString("0.00"), ubc.OpenAcctId, cashChl, servf.ToString("0.00"), FeeObjFlag); if (mc != null) { M_td_UserCash mu = new M_td_UserCash(); B_td_UserCash mo = new B_td_UserCash(); mu.registerid = p.registerid; mu.UsrCustId = p.UsrCustId; mu.TransAmt = decimal.Parse(mc.TransAmt); mu.FeeAmt = servf; mu.OrdId = mc.OrdId; mu.OrdIdTime = DateTime.Now; mu.OrdIdState = 0; mu.FeeObjFlag = FeeObjFlag; mu.CashChl = cashChl; mo.Add(mu); } return(View(mc)); }