Esempio n. 1
0
        /// <summary>
        /// 绑定银行卡
        /// </summary>
        /// <returns></returns>
        public ActionResult SetDrawAccount()
        {
            try
            {
                NameValueCollection parmas = WorkContext.postparms;
                //包含imei号
                if (parmas.Keys.Count != 7)
                {
                    return(APIResult("error", "缺少请求参数"));
                }

                MD_DrawAccount draw = new MD_DrawAccount
                {
                    Account     = parmas["account"],
                    Username    = parmas["username"],
                    Card        = parmas["cardname"],
                    Cardnum     = parmas["cardnum"],
                    Cardaddress = parmas["cardaddress"],
                    Drawpwd     = parmas["pwd"]
                };

                bool result = Recharge.ValidateDrawPwd(parmas["account"]);

                if (!result)
                {
                    return(APIResult("error", "未设置提现密码"));
                }


                PartUserInfo partUserInfo = Users.GetPartUserByMobile(parmas["account"]);

                draw.Drawpwd = Users.CreateUserPassword(draw.Drawpwd, partUserInfo.Salt);

                bool pwdres = Recharge.ValidateDrawPwd(draw.Account, draw.Drawpwd);
                if (!pwdres)
                {
                    return(APIResult("error", "提现密码错误"));
                }
                bool saveres = Recharge.UpdateDrawCardInfo(draw);
                if (saveres)
                {
                    return(APIResult("success", "保存成功"));
                }
                else
                {
                    return(APIResult("error", "保存失败"));
                }
            }
            catch (Exception ex)
            {
                return(APIResult("error", "保存失败"));
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 绑定银行卡
        /// </summary>
        /// <returns></returns>
        public ActionResult SetDrawAccount()
        {
            try
            {
                NameValueCollection parmas = WorkContext.postparms;
                var            id          = parmas["id"];
                MD_DrawAccount draw        = new MD_DrawAccount
                {
                    Uid         = WorkContext.Uid,
                    Username    = parmas["username"],
                    Drawaccid   = Convert.ToInt32(parmas["id"]),
                    Card        = parmas["cardname"],
                    Cardnum     = parmas["cardnum"],
                    Cardaddress = "",// parmas["cardaddress"],
                    Drawpwd     = parmas["pwd"]
                };

                bool result = Recharge.ValidateDrawPwdByUid(WorkContext.Uid);

                if (!result)
                {
                    return(APIResult("error", "未设置提现密码"));
                }


                PartUserInfo partUserInfo = Users.GetPartUserById(WorkContext.Uid);

                //draw.Drawpwd = Users.CreateUserPassword(draw.Drawpwd, partUserInfo.Salt);

                bool pwdres = Recharge.ValidateDrawPwdByUid(WorkContext.Uid, draw.Drawpwd);
                if (!pwdres)
                {
                    return(APIResult("error", "提现密码错误"));
                }
                bool saveres = Recharge.UpdateDrawCardInfo(draw);
                if (saveres)
                {
                    return(APIResult("success", "保存成功"));
                }
                else
                {
                    return(APIResult("error", "保存失败"));
                }
            }
            catch (Exception ex)
            {
                return(APIResult("error", "保存失败"));
            }
        }
Esempio n. 3
0
        public ActionResult EditBank(MD_DrawAccount model)
        {
            ViewData["referer"] = ShopUtils.GetAdminRefererCookie();
            List <MD_DrawAccount> list = Recharge.GetDrawAccountList(1, 1, " where  rtrim(b.mobile)='" + model.Account + "'");

            if (list.Count > 0)
            {
                MD_DrawAccount draw = list[0];
                draw.Username = model.Username;
                bool result = Recharge.UpdateDrawCardInfo(draw);
                if (result)
                {
                    return(PromptView("更新成功"));
                }
                else
                {
                    return(PromptView("更新失败"));
                }
            }
            else
            {
                return(PromptView("获取用户银行卡信息失败"));
            }
        }