Esempio n. 1
0
        public ActionResult DrawPwd()
        {
            bool result = Recharge.ValidateDrawPwdByUid(WorkContext.Uid);

            ViewData["isext"] = result;
            return(View());
        }
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
        /// <summary>
        /// 设置提现密码
        /// </summary>
        /// <returns></returns>
        public ActionResult DrawPwd()
        {
            try
            {
                NameValueCollection parmas = WorkContext.postparms;

                MD_DrawAccount draw = new MD_DrawAccount
                {
                    Uid     = WorkContext.Uid,
                    Drawpwd = parmas["password"]
                };

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

                //draw.Drawpwd = Users.CreateUserPassword(draw.Drawpwd, partUserInfo.Salt);
                if (parmas.AllKeys.Contains("oldpwd") && parmas["oldpwd"] != "")
                {
                    //string oldpwd = Users.CreateUserPassword(parmas["oldpwd"], partUserInfo.Salt);
                    string oldpwd = parmas["oldpwd"];
                    bool   pwdres = Recharge.ValidateDrawPwdByUid(WorkContext.Uid, oldpwd);
                    if (!pwdres)
                    {
                        return(APIResult("error", "原有密码错误"));
                    }
                }
                if (partUserInfo.Password == draw.Drawpwd)
                {
                    return(APIResult("error", "提现密码和登录密码不能一致"));
                }

                bool saveres = Recharge.UpdateDrawPWD(draw);
                if (saveres)
                {
                    return(APIResult("success", "保存成功"));
                }
                else
                {
                    return(APIResult("error", "保存失败"));
                }
            }
            catch (Exception ex)
            {
                return(APIResult("error", "保存失败"));
            }
        }
Esempio n. 4
0
        public ActionResult Draw()
        {
            ViewData["money"] = Users.GetPartUserById(WorkContext.Uid).TotalMoney;
            List <DrawInfoModel> list = Recharge.GetDrawList(1, -1, " where a.uid=" + WorkContext.Uid.ToString() + " and CONVERT(varchar(10),a.addtime,120)=CONVERT(varchar(10),getdate(),120)");
            int count = 3;

            if (list == null || list.Count == 0)
            {
                count = 3;
            }
            else if (list.Count >= 3)
            {
                count = 0;
            }
            else
            {
                count = 3 - list.Count;
            }
            ViewData["drawcount"] = count;
            ViewData["setdraw"]   = Recharge.ValidateDrawPwdByUid(WorkContext.Uid).ToString().ToLower();
            return(View());
        }
Esempio n. 5
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", "提交失败");
            }
        }