Example #1
0
        /// <summary>
        /// 提现申请
        /// </summary>
        /// <returns></returns>
        public ActionResult UserDraw()
        {
            NameValueCollection parmas = WorkContext.postparms;

            if (parmas.Keys.Count != 4)
            {
                return(APIResult("error", "缺少请求参数"));
            }
            string  account = parmas["account"];
            decimal money   = decimal.Parse(parmas["money"]);

            if (money < 100)
            {
                return(APIResult("error", "最低请提现100元宝"));
            }

            PartUserInfo partUserInfo = Users.GetPartUserByMobile(account);

            if (partUserInfo.TotalMoney < money)
            {
                return(APIResult("error", "余额不足"));
            }

            string mdpwd = Users.CreateUserPassword(parmas["password"], partUserInfo.Salt);

            bool pwdres = Recharge.ValidateDrawPwd(account, mdpwd);

            if (!pwdres)
            {
                return(APIResult("error", "提现密码错误"));
            }

            DrawInfoModel draw = new DrawInfoModel
            {
                Account = account,
                Money   = int.Parse(parmas["money"]),
            };
            string addres = Recharge.AddDraw(draw);

            if (addres.EndsWith("成功"))
            {
                return(APIResult("success", "申请成功"));
            }
            else if (addres == "-1")
            {
                return(APIResult("error", "余额不足"));
            }
            else
            {
                return(APIResult("error", "申请失败"));
            }
        }
Example #2
0
        /// <summary>
        /// 提现申请
        /// </summary>
        /// <returns></returns>
        public ActionResult UserDraw()
        {
            NameValueCollection parmas = WorkContext.postparms;

            if (!Recharge.ValidateDrawPwdByUid(WorkContext.Uid))
            {
                return(Content("5"));//没有设置提现密码
            }

            if (parmas["drawaccid"] == "")
            {
                return(Content("6"));//没有添加银行卡信息
            }
            List <MD_DrawAccount> drawgt = Recharge.GetDrawAccountList(1, 1, " where a.drawaccid=" + parmas["drawaccid"].ToString() + "");

            if (drawgt == null || drawgt.Count == 0)
            {
                return(Content("6"));//没有添加银行卡信息
            }
            //string account = parmas["account"];
            decimal money = decimal.Parse(parmas["money"]);

            if (money < 100)
            {
                //return APIResult("error", "最低请提现100元");
                return(Content("2"));
            }

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

            if (partUserInfo.TotalMoney < money)
            {
                //return APIResult("error", "账户余额不足");
                return(Content("2"));
            }

            string mdpwd = parmas["password"];// Users.CreateUserPassword(parmas["password"], partUserInfo.Salt);

            bool pwdres = Recharge.ValidateDrawPwdByUid(WorkContext.Uid, mdpwd);

            if (!pwdres)
            {
                //return APIResult("error", "提现密码错误");
                return(Content("1"));
            }

            DrawInfoModel draw = new DrawInfoModel
            {
                Uid       = WorkContext.Uid,
                Money     = int.Parse(parmas["money"]),
                Drawaccid = int.Parse(parmas["drawaccid"])
            };
            string addres = Recharge.AddDraw(draw);

            if (addres.EndsWith("成功"))
            {
                return(Content("4"));
                //return APIResult("success", "已经提交请等待客服处理");
            }
            else if (addres == "-1")
            {
                //return APIResult("error", "账户余额不足");
                return(Content("2"));
            }
            else
            {
                return(Content("3"));
                //return APIResult("error", "提交失败");
            }
        }