Пример #1
0
        public ActionResult EditDraw(MD_DrawAccount model, int uid = -1)
        {
            UserInfo userInfo = AdminUsers.GetUserById(uid);

            if (userInfo == null)
            {
                return(PromptView("用户不存在"));
            }

            if (ModelState.IsValid)
            {
                model.Drawpwd = Users.CreateUserPassword(model.Drawpwd, userInfo.Salt);
                model.Account = userInfo.Mobile;
                bool result = false;

                result = Recharge.UpdateDrawPWD(model);
                if (result)
                {
                    return(PromptView("提现密码修改成功"));
                }
                else
                {
                    return(PromptView("提现密码修改失败"));
                }
            }
            Load(0);

            return(View(model));
        }
Пример #2
0
        public ActionResult Edit(int uid = -1)
        {
            UserInfo userInfo = AdminUsers.GetUserById(uid);

            if (userInfo == null)
            {
                return(PromptView("用户不存在"));
            }

            UserModel model = new UserModel();

            model.UserName   = userInfo.UserName;
            model.Email      = userInfo.Email;
            model.Mobile     = userInfo.Mobile;
            model.UserRid    = userInfo.UserRid;
            model.AdminGid   = userInfo.AdminGid;
            model.NickName   = userInfo.NickName;
            model.Avatar     = userInfo.Avatar;
            model.PayCredits = userInfo.PayCredits;
            model.Gender     = userInfo.Gender;
            model.RealName   = userInfo.RealName;
            model.Bday       = userInfo.Bday;
            model.IdCard     = userInfo.IdCard;
            model.RegionId   = userInfo.RegionId;
            model.Address    = userInfo.Address;
            model.Bio        = userInfo.Bio;

            Load(model.RegionId);

            return(View(model));
        }
Пример #3
0
        public ActionResult UpdAccount(int id, decimal fee)
        {
            UserInfo userInfo = AdminUsers.GetUserById(id);

            if (userInfo == null)
            {
                return(AjaxResult("success", "用户不存在"));
            }
            var result = Users.UpdateUserAccount(id, fee);

            if (result)
            {
                MD_Change achange = new MD_Change()
                {
                    Account     = userInfo.Mobile,
                    Accounted   = userInfo.TotalMoney,
                    Changemoney = fee,
                    Remark      = fee > 1?"上分":"下分"
                };
                var s = NewUser.AddAChange(achange);
                AddAdminOperateLog("修改用户账余", "修改用户账余,用户ID为:" + id);
                return(AjaxResult("success", "修改用户账余成功"));
            }
            else
            {
                return(AjaxResult("error", "用户账余修改失败"));
            }
        }
Пример #4
0
        public ActionResult Edit(UserModel model, int uid = -1)
        {
            UserInfo userInfo = AdminUsers.GetUserById(uid);

            if (userInfo == null)
            {
                return(PromptView("用户不存在"));
            }


            int uid4 = AdminUsers.GetUidByMobile(model.Mobile);

            if (uid4 > 0 && uid4 != uid)
            {
                ModelState.AddModelError("Mobile", "手机号已经存在");
            }

            if (ModelState.IsValid)
            {
                string nickName;
                if (string.IsNullOrWhiteSpace(model.NickName))
                {
                    nickName = userInfo.NickName;
                }
                else
                {
                    nickName = model.NickName;
                }

                userInfo.UserName = model.Mobile;
                userInfo.Mobile   = model.Mobile;
                if (!string.IsNullOrWhiteSpace(model.Password))
                {
                    userInfo.Password = Users.CreateUserPassword(model.Password, userInfo.Salt);
                }
                userInfo.UserRid  = model.UserRid == 0 ? 7 : model.UserRid;
                userInfo.NickName = WebHelper.HtmlEncode(nickName);

                userInfo.AdminGid = model.AdminGid;
                bool result = false;


                result = AdminUsers.UpdateUser(userInfo);
                if (result)
                {
                    AddAdminOperateLog("修改用户", "修改用户,用户ID为:" + uid);
                    return(PromptView("用户修改成功"));
                }
                else
                {
                    return(PromptView("用户修改失败"));
                }
            }

            Load(model.RegionId);

            return(View(model));
        }
Пример #5
0
        public ActionResult Edit(int uid = -1)
        {
            UserInfo userInfo = AdminUsers.GetUserById(uid);

            if (userInfo == null)
            {
                return(PromptView("用户不存在"));
            }

            UserModel model = new UserModel();

            model.UserName = userInfo.UserName;
            model.Mobile   = userInfo.Mobile;
            model.NickName = userInfo.NickName;
            model.Password = userInfo.Password;
            model.UserRid  = userInfo.UserRid;
            model.AdminGid = userInfo.AdminGid;
            Load(model.RegionId);
            return(View(model));
        }
Пример #6
0
        public ActionResult EditDraw(int uid = -1)
        {
            UserInfo userInfo = AdminUsers.GetUserById(uid);

            if (userInfo == null)
            {
                return(PromptView("用户不存在"));
            }
            Load(0);
            List <MD_DrawAccount> list = Recharge.GetDrawAccountList(1, 1, " where a.uid=" + uid);
            MD_DrawAccount        draw = new MD_DrawAccount();

            if (list.Count > 0)
            {
                draw         = list[0];
                draw.Drawpwd = "";
                return(View(draw));
            }
            else
            {
                return(PromptView("用户未绑定银行卡"));
            }
        }
Пример #7
0
        public ActionResult EditUser(UserModel model, int uid = -1)
        {
            UserInfo userInfo = AdminUsers.GetUserById(uid);

            if (userInfo == null)
            {
                return(PromptView("用户不存在"));
            }


            if (ModelState.IsValid)
            {
                string UserName   = model.UserName;
                string password   = model.Password;
                string drawpwd    = model.DrawPwd;
                string totalmoney = model.TotalMoney.ToString();
                //string mytype = model.MyType;
                string money  = model.Money;
                string bio    = model.Bio;
                bool   result = false;

                result = AdminUsers.UpdateUser(UserName, password, drawpwd, totalmoney, bio);
                if (result)
                {
                    AddAdminOperateLog("修改用户", "修改用户,用户ID为:" + uid);
                    return(PromptView("用户修改成功"));
                }
                else
                {
                    return(PromptView("用户修改失败"));
                }
            }

            Load(model.RegionId);

            return(View(model));
        }
Пример #8
0
        public ActionResult Edit(UserModel model, int uid = -1)
        {
            UserInfo userInfo = AdminUsers.GetUserById(uid);

            if (userInfo == null)
            {
                return(PromptView("用户不存在"));
            }

            int uid2 = AdminUsers.GetUidByUserName(model.UserName);

            if (uid2 > 0 && uid2 != uid)
            {
                ModelState.AddModelError("UserName", "用户名已经存在");
            }

            int uid3 = AdminUsers.GetUidByEmail(model.Email);

            if (uid3 > 0 && uid3 != uid)
            {
                ModelState.AddModelError("Email", "邮箱已经存在");
            }

            int uid4 = AdminUsers.GetUidByMobile(model.Mobile);

            if (uid4 > 0 && uid4 != uid)
            {
                ModelState.AddModelError("Mobile", "手机号已经存在");
            }

            if (ModelState.IsValid)
            {
                string nickName;
                if (string.IsNullOrWhiteSpace(model.NickName))
                {
                    nickName = userInfo.NickName;
                }
                else
                {
                    nickName = model.NickName;
                }

                userInfo.UserName = model.UserName;
                userInfo.Email    = model.Email == null ? "" : model.Email;
                userInfo.Mobile   = model.Mobile == null ? "" : model.Mobile;
                if (!string.IsNullOrWhiteSpace(model.Password))
                {
                    userInfo.Password = Users.CreateUserPassword(model.Password, userInfo.Salt);
                }
                userInfo.UserRid     = model.UserRid;
                userInfo.AdminGid    = model.AdminGid;
                userInfo.NickName    = WebHelper.HtmlEncode(nickName);
                userInfo.Avatar      = model.Avatar == null ? "" : WebHelper.HtmlEncode(model.Avatar);
                userInfo.PayCredits  = model.PayCredits;
                userInfo.RankCredits = userInfo.UserRid == model.UserRid ? userInfo.RankCredits : AdminUserRanks.GetUserRankById(model.UserRid).CreditsLower;
                userInfo.LiftBanTime = UserRanks.IsBanUserRank(model.UserRid) ? DateTime.Now.AddDays(WorkContext.UserRankInfo.LimitDays) : new DateTime(1900, 1, 1);
                userInfo.Gender      = model.Gender;
                userInfo.RealName    = model.RealName == null ? "" : WebHelper.HtmlEncode(model.RealName);
                userInfo.Bday        = model.Bday ?? new DateTime(1970, 1, 1);
                userInfo.IdCard      = model.IdCard == null ? "" : model.IdCard;
                userInfo.RegionId    = model.RegionId;
                userInfo.Address     = model.Address == null ? "" : WebHelper.HtmlEncode(model.Address);
                userInfo.Bio         = model.Bio == null ? "" : WebHelper.HtmlEncode(model.Bio);

                AdminUsers.UpdateUser(userInfo);
                AddAdminOperateLog("修改用户", "修改用户,用户ID为:" + uid);
                return(PromptView("用户修改成功"));
            }

            Load(model.RegionId);

            return(View(model));
        }