예제 #1
0
        public ActionResult UserBankAdd()
        {
            M_User_Bank bankMod = bankBll.SelReturnModel(Mid);

            if (bankMod == null)
            {
                bankMod = new M_User_Bank();
            }
            return(View(bankMod));
        }
예제 #2
0
        public void UserBank_Add()
        {
            M_User_Bank bankMod = bankBll.SelReturnModel(Mid);

            if (bankMod == null)
            {
                bankMod = new M_User_Bank();
            }
            bankMod.CardType   = Request.Form["CardType_rad"];
            bankMod.BankName   = Request.Form["BankName"];
            bankMod.PeopleName = Request.Form["PeopleName"];
            bankMod.CardNum    = Request.Form["CardNum"];
            bankMod.Remark     = Request.Form["Remark"];
            bankMod.QRCode     = Request.Form["QRCode_T"];
            if (string.IsNullOrEmpty(bankMod.BankName))
            {
                function.WriteErrMsg("银行名称不能为空"); return;
            }
            if (string.IsNullOrEmpty(bankMod.PeopleName))
            {
                function.WriteErrMsg("用户名称不能为空"); return;
            }
            if (string.IsNullOrEmpty(bankMod.CardNum))
            {
                function.WriteErrMsg("银行卡号不能为空"); return;
            }
            if (bankMod.ID > 0)
            {
                if (bankMod.UserID != mu.UserID)
                {
                    function.WriteErrMsg("你无权修改该信息"); return;
                }
                bankBll.UpdateByID(bankMod);
            }
            else
            {
                bankMod.UserID = mu.UserID;
                bankBll.Insert(bankMod);
            }
            function.WriteSuccessMsg("操作成功", "UserBank");
        }
예제 #3
0
        public IActionResult UserBank_Add()
        {
            M_User_Bank bankMod = bankBll.SelReturnModel(Mid);

            if (bankMod == null)
            {
                bankMod = new M_User_Bank();
            }
            bankMod.CardType   = RequestEx["CardType_rad"];
            bankMod.BankName   = RequestEx["BankName"];
            bankMod.PeopleName = RequestEx["PeopleName"];
            bankMod.CardNum    = RequestEx["CardNum"];
            bankMod.Remark     = RequestEx["Remark"];
            bankMod.QRCode     = RequestEx["QRCode_T"];
            if (string.IsNullOrEmpty(bankMod.BankName))
            {
                return(WriteErr("银行名称不能为空"));
            }
            if (string.IsNullOrEmpty(bankMod.PeopleName))
            {
                return(WriteErr("用户名称不能为空"));
            }
            if (string.IsNullOrEmpty(bankMod.CardNum))
            {
                return(WriteErr("银行卡号不能为空"));
            }
            if (bankMod.ID > 0)
            {
                if (bankMod.UserID != mu.UserID)
                {
                    return(WriteErr("你无权修改该信息"));
                }
                bankBll.UpdateByID(bankMod);
            }
            else
            {
                bankMod.UserID = mu.UserID;
                bankBll.Insert(bankMod);
            }
            return(WriteOK("操作成功", "UserBank"));
        }
예제 #4
0
 public int Insert(M_User_Bank model)
 {
     return(DBCenter.Insert(model));
 }
예제 #5
0
 public bool UpdateByID(M_User_Bank model)
 {
     return(DBCenter.UpdateByID(model, model.ID));
 }
예제 #6
0
        public void WithDraw_Add()
        {
            M_UserInfo mu       = buser.GetLogin(false);
            double     money    = Convert.ToDouble(Request.Form["Money_T"]);
            double     fee      = SiteConfig.UserConfig.WD_FeePrecent > 0 ? (money * (SiteConfig.UserConfig.WD_FeePrecent / 100)) : 0;
            string     shortPwd = Request.Form["ShortPwd_T"];

            if (money < 1)
            {
                function.WriteErrMsg("提现金额错误,不能小于1"); return;
            }
            if (money < SiteConfig.UserConfig.WD_Min)
            {
                function.WriteErrMsg("提现金额必须>=[" + SiteConfig.UserConfig.WD_Min + "]"); return;
            }
            if (SiteConfig.UserConfig.WD_Max > 0 && money > SiteConfig.UserConfig.WD_Max)
            {
                function.WriteErrMsg("提现金额必须小于[" + SiteConfig.UserConfig.WD_Max + "]");
                return;
            }
            if (SiteConfig.UserConfig.WD_Multi > 0 && (money % SiteConfig.UserConfig.WD_Multi) != 0)
            {
                function.WriteErrMsg("提现金额必须是[" + SiteConfig.UserConfig.WD_Multi + "]的倍数");
                return;
            }
            if (mu.Purse < (money + fee))
            {
                function.WriteErrMsg("你只有[" + mu.Purse.ToString("f2") + "],需[" + (money + fee).ToString("F2") + "]才可提现"); return;
            }
            if (string.IsNullOrEmpty(shortPwd))
            {
                function.WriteErrMsg("未输入支付密码"); return;
            }
            if (!mu.PayPassWord.Equals(StringHelper.MD5(shortPwd)))
            {
                function.WriteErrMsg("支付密码不正确"); return;
            }
            //生成提现单据
            M_Cash cashMod = new M_Cash();

            cashMod.UserID      = mu.UserID;
            cashMod.money       = money;
            cashMod.WithDrawFee = fee;
            cashMod.YName       = mu.UserName;
            cashMod.CardType    = Request.Form["cardType_rad"];
            cashMod.Remark      = Request.Form["Remark_T"];
            switch (cashMod.CardType)
            {
            case "银行卡":
            {
                cashMod.Account    = Request.Form["Account_T"];
                cashMod.Bank       = Request.Form["Bank_T"];
                cashMod.PeopleName = Request.Form["PName_T"];
            }
            break;

            default:    //其它网络支付方式
            {
                cashMod.Account    = Request.Form["Net_Account_T"];
                cashMod.Bank       = cashMod.CardType;
                cashMod.PeopleName = Request.Form["Net_PName_T"];
                cashMod.QRcode     = Request.Form["QRCode_t"];
            }
            break;
            }

            //银行账户信息
            int         bankid  = DataConverter.CLng(Request.Form["bankid"]);
            M_User_Bank bankMod = bankBll.SelReturnModel(bankid);

            //账户不存在则新增
            if (bankMod == null || !bankMod.CardNum.Equals(cashMod.Account.Trim()))
            {
                bankMod            = new M_User_Bank();
                bankMod.CardNum    = cashMod.Account;
                bankMod.BankName   = cashMod.Bank;
                bankMod.PeopleName = cashMod.PeopleName;
                bankMod.Remark     = cashMod.Remark;
                bankMod.UserID     = mu.UserID;
                bankMod.ID         = bankBll.Insert(bankMod);
            }
            buser.MinusVMoney(mu.UserID, money, M_UserExpHis.SType.Purse, cashMod.Remark);
            if (cashMod.WithDrawFee > 0)
            {
                buser.MinusVMoney(mu.UserID, cashMod.WithDrawFee, M_UserExpHis.SType.Purse, "提现手续费率" + SiteConfig.SiteOption.MastMoney.ToString("F2") + "%");
            }
            cashBll.insert(cashMod);
            function.WriteSuccessMsg("提现申请成功,请等待管理员审核", "WithDrawLog");
        }