public JsonResult SubmitWithdraw(string Id, string Withdraw_shenhe, string Withdraw_shenheDesc) { Finance_WithDraw model = ServiceHelper.Create <IFinance_WithDrawService>().GetFinance_WithDrawInfo(long.Parse(Id)); model.Withdraw_shenhe = int.Parse(Withdraw_shenhe); model.Withdraw_shenheDesc = Withdraw_shenheDesc; if (Withdraw_shenhe == "1") { model.Withdraw_Status = 1; } model.Withdraw_shenheTime = DateTime.Now; model.Withdraw_shenheUid = CurrentManager.Id; model.Withdraw_shenheUname = CurrentManager.UserName; bool result = ServiceHelper.Create <IFinance_WithDrawService>().UpdateFinance_WithDraw(model); if (result) { Finance_Wallet _Finance_Wallet = ServiceHelper.Create <IFinance_WalletService>().GetWalletInfo(model.Withdraw_UserId, model.Withdraw_UserType, model.Withdraw_MoneyType); if (Withdraw_shenhe == "1") { //提现通过 _Finance_Wallet.Wallet_UserMoneyLock = _Finance_Wallet.Wallet_UserMoneyLock - model.Withdraw_Money; } else if (Withdraw_shenhe == "2") { //拒绝提现 _Finance_Wallet.Wallet_UserMoneyLock = _Finance_Wallet.Wallet_UserMoneyLock - model.Withdraw_Money; _Finance_Wallet.Wallet_UserLeftMoney = _Finance_Wallet.Wallet_UserLeftMoney + model.Withdraw_Money; } ServiceHelper.Create <IFinance_WalletService>().UpdateFinance_Wallet(_Finance_Wallet); } return(Json(new { success = result })); }
/// <summary> /// 提交提现操作 /// </summary> /// <param name="amount">提现金额</param> /// <param name="pwd">支付密码</param> /// <returns></returns> public JsonResult ApplyWithDrawSubmit(decimal amount, string pwd) { Finance_Wallet fwino = ServiceHelper.Create <IFinance_WalletService>().GetWalletInfo(base.CurrentUser.Id, base.CurrentUser.UserType, int.Parse(ConfigurationManager.AppSettings["CoinType"])); if (fwino == null) { Log.Error("用户" + base.CurrentUser.Id + "在" + DateTime.Now + "时提现 获取提现信息失败."); return(Json("")); } else { if (!pwd.Equals(fwino.Wallet_PayPassword)) { throw new HimallException("支付密码不对,请重新输入!"); } else { if (amount > fwino.Wallet_UserLeftMoney) { throw new HimallException("提现金额不能超出可用金额!"); } else { //创建提现记录 并且更新用户提现后的钱包 Finance_WithDraw fwdinfo = new Finance_WithDraw(); ChemCloud.Service.Order.Business.OrderBO _orderBO = new ChemCloud.Service.Order.Business.OrderBO(); fwdinfo.Withdraw_Number = _orderBO.GenerateOrderNumber(); fwdinfo.Withdraw_UserId = base.CurrentUser.Id; fwdinfo.Withdraw_UserType = base.CurrentUser.UserType; fwdinfo.Withdraw_Money = amount; fwdinfo.Withdraw_MoneyType = int.Parse(ConfigurationManager.AppSettings["CoinType"]); fwdinfo.Withdraw_BankName = fwino.Wallet_UserBankName; fwdinfo.Withdraw_BankUserName = fwino.Wallet_UserBankUserName; fwdinfo.Withdraw_Account = fwino.Wallet_UserBankNumber; fwdinfo.Withdraw_Time = DateTime.Now; fwdinfo.Withdraw_Status = 0; fwdinfo.Withdraw_shenhe = 0; fwdinfo.Withdraw_shenheDesc = ""; fwdinfo.Withdraw_shenheTime = DateTime.Now; fwdinfo.Withdraw_shenheUid = 0; fwdinfo.Withdraw_shenheUname = ""; fwino.Wallet_UserMoneyLock = amount; fwino.Wallet_UserLeftMoney = fwino.Wallet_UserLeftMoney - amount; fwino.Wallet_DoIpAddress = ChemCloud.Core.Common.GetIpAddress(); fwino.Wallet_DoLastTime = DateTime.Now; fwino.Wallet_DoUserId = base.CurrentUser.Id; fwino.Wallet_DoUserName = base.CurrentUser.UserName; if (ServiceHelper.Create <IFinance_WithDrawService>().AddFinance_WithDraw(fwdinfo) && ServiceHelper.Create <IFinance_WalletService>().UpdateFinance_Wallet(fwino)) { return(Json("ok")); } else { Log.Error("用户" + base.CurrentUser.Id + "在" + DateTime.Now + "时添加提现记录失败."); return(Json("")); } } } } }
public ActionResult AuditFinance_WithDrawList_Detail(long id) { Finance_WithDraw model = ServiceHelper.Create <IFinance_WithDrawService>().GetFinance_WithDrawInfo(id); model.Withdraw_UserName = ServiceHelper.Create <IMemberService>().GetMember(model.Withdraw_UserId) == null ? "" : ServiceHelper.Create <IMemberService>().GetMember(model.Withdraw_UserId).UserName; return(View(model)); }
public Finance_WithDraw GetFinance_WithDrawInfo(long uid, int usertype) { Finance_WithDraw finfo = new Finance_WithDraw(); finfo = ( from p in context.Finance_WithDraw where p.Withdraw_UserId.Equals(uid) && p.Withdraw_UserType.Equals(usertype) select p).FirstOrDefault(); return(finfo); }
public Finance_WithDraw GetFinance_WithDrawInfo(long id) { Finance_WithDraw finfo = new Finance_WithDraw(); finfo = ( from p in context.Finance_WithDraw where p.Id.Equals(id) select p).FirstOrDefault(); return(finfo); }
public bool AddFinance_WithDraw(Finance_WithDraw finfo) { int i = 0; if (finfo == null || finfo.Id != 0) { return(false); } context.Finance_WithDraw.Add(finfo); i = context.SaveChanges(); if (i > 0) { return(true); } else { return(false); } }
public bool UpdateFinance_WithDraw(Finance_WithDraw finfo) { if (finfo == null) { return(false); } Finance_WithDraw f = context.Finance_WithDraw.FirstOrDefault((Finance_WithDraw m) => m.Id == finfo.Id); if (f == null) { return(false); } int i = 0; f.Withdraw_Number = finfo.Withdraw_Number; f.Withdraw_UserId = finfo.Withdraw_UserId; f.Withdraw_UserType = finfo.Withdraw_UserType; f.Withdraw_Money = finfo.Withdraw_Money; f.Withdraw_MoneyType = finfo.Withdraw_MoneyType; f.Withdraw_BankName = finfo.Withdraw_BankName; f.Withdraw_BankUserName = finfo.Withdraw_BankUserName; f.Withdraw_Account = finfo.Withdraw_Account; f.Withdraw_Time = finfo.Withdraw_Time; f.Withdraw_Status = finfo.Withdraw_Status; f.Withdraw_shenhe = finfo.Withdraw_shenhe; f.Withdraw_shenheUid = finfo.Withdraw_shenheUid; f.Withdraw_shenheUname = finfo.Withdraw_shenheUname; f.Withdraw_shenheDesc = finfo.Withdraw_shenheDesc; f.Withdraw_shenheTime = finfo.Withdraw_shenheTime; i = context.SaveChanges(); if (i > 0) { return(true); } else { return(false); } }