Esempio n. 1
0
        public ActionResult ManitoFunPlay()
        {
            User user = new User()
            {
                UserId        = new OperatorProvider <FrontCurrentUser>().GetCurrent().UserId,
                HomePage_Img  = Request["homeImg"],
                Sex           = int.Parse(Request["sex"]),
                CurrentCity   = Request["city"],
                PersonalPhoto = Request["photo"],
                PersonalAudio = Request["audio"],
            };
            R_Game_User_Play game = new R_Game_User_Play()
            {
                Games_GameId      = int.Parse(Request["gameId"]),
                GameAreaId        = int.Parse(Request["areaId"]),
                GameRatingId      = int.Parse(Request["ratingId"]),
                GameRating_CutImg = Request["ratingImg"],
                OnlinePrice       = int.Parse(Request["onPrice"]),
                OfflinePrice      = int.Parse(Request["offPrice"]),
                TagName           = Request["tagName"],
                ServiceNote       = Request["serviceNote"],
                GameScore_CutImg  = Request["scoreImg"],
                Type = (int)ProjectType.FunPlay
            };

            if (IocUtils.Resolve <IR_Game_User_PlayService>().InsertFunPlay(game, user))
            {
                return(Content("ok,恭喜:信息提交成功!"));
            }
            else
            {
                return(Content("no,提示:游戏信息认证失败了!"));
            }
        }
Esempio n. 2
0
 public bool Login(string str, string password, out string msg, out User userInfo)
 {
     userInfo = IocUtils.Resolve <IUserRepository>().GetModel(name: str);
     if (userInfo != null)
     {
         if (userInfo.State == true)
         {
             if (DESEncrypt.Encrypt(password).Equals(userInfo.Password))
             {
                 //登录成功了,写其他业务;
                 userInfo.Last_Login_IP   = Net.Ip;
                 userInfo.Last_Login_Time = DateTime.Now;
                 IocUtils.Resolve <IUserRepository>().Update(userInfo);
                 msg = "ok,恭喜:登录成功!";
                 return(true);
             }
             else
             {
                 msg = "no,提示:密码错误!";
                 return(false);
             }
         }
         else
         {
             msg = "no,账户被系统锁定,请联系管理员!";
             return(false);
         }
     }
     else
     {
         msg = "no,账户不存在,请重新输入!";
         return(false);
     }
 }
Esempio n. 3
0
        public ActionResult SendVcode(string phone, string vcode)
        {
            var validatecode = Session["user_vcode"].ToString() == null ? "" : Session["user_vcode"].ToString();

            if (string.IsNullOrEmpty(vcode))
            {
                return(Content("提示:验证码错误!"));
            }
            if (!validatecode.Equals(vcode, StringComparison.CurrentCultureIgnoreCase))
            {
                return(Content("提示:验证码错误!"));
            }
            if (phone.Length != 11 && phone.ToString() == null)
            {
                return(Content("提示:手机号码不正确"));
            }
            Random r       = new Random();
            string code2   = r.Next(100000, 999999).ToString();
            string ip      = Net.Ip;
            string outCode = IocUtils.Resolve <IUserService>().OutCode(phone, code2, ip);

            if (outCode != null)
            {
                string msg = VCode.SendVCode(phone, outCode);
                return(Content(msg));
            }
            else
            {
                return(Content("您的验证码短信仍在30分钟有效期内"));
            }
        }
Esempio n. 4
0
        public JsonResult GetGameRatingList(int gameId)
        {
            var ratingList = IocUtils.Resolve <IGameRatingService>().GetList(gameId).ToJson();
            var areaList   = IocUtils.Resolve <IGameAreaService> ().GetList(gameId).ToJson();

            return(Json(new { Rating = ratingList, Area = areaList }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 5
0
        /// <summary>
        /// 大神主页
        /// </summary>
        /// <returns></returns>
        public ActionResult ManitoHomepage()
        {
            var user = new OperatorProvider <FrontCurrentUser>().GetCurrent();

            ViewData.Model     = user as FrontCurrentUser;
            ViewBag.FocusCount = IocUtils.Resolve <IFocusService>().GetFocusList(user.UserId, true).Count;
            ViewBag.FansCount  = IocUtils.Resolve <IFocusService>().GetFocusList(user.UserId, false).Count;
            return(View());
        }
Esempio n. 6
0
        // GET: UserManage/User
        public ActionResult Index()
        {
            var user = new OperatorProvider <FrontCurrentUser>().GetCurrent();

            ViewData.Model      = user as FrontCurrentUser;
            ViewBag.FreezeMoney = IocUtils.Resolve <IMoneyService>().UserMoney(user.UserId, false);
            ViewBag.UsableMoney = IocUtils.Resolve <IMoneyService>().UserMoney(user.UserId, true);
            ViewBag.FocusCount  = IocUtils.Resolve <IFocusService>().GetFocusList(user.UserId, true).Count;
            ViewBag.FansCount   = IocUtils.Resolve <IFocusService>().GetFocusList(user.UserId, false).Count;
            return(View());
        }
Esempio n. 7
0
 public ActionResult IsUserWhere(string where)
 {
     if (IocUtils.Resolve <IUserService>().IsExistUserWhere(where))
     {
         return(Content("exist"));
     }
     else
     {
         return(Content("noExist"));
     }
 }
Esempio n. 8
0
 public ActionResult CheckMobileCode(string mobile, string code)
 {
     if (IocUtils.Resolve <IVCodeService>().CheckMobileCode(mobile, code))
     {
         return(Content("ok"));
     }
     else
     {
         return(Content("no"));
     }
 }
Esempio n. 9
0
        public bool IsExistUserWhere(string where)
        {
            User userInfo = IocUtils.Resolve <IUserRepository>().GetModel(name: where);

            if (userInfo != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 10
0
        public bool CheckMobileCode(string mobile, string code)
        {
            int i = IocUtils.Resolve <IVCodeRepository>().CheckMobileCode(mobile, code);

            if (i > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 11
0
        public ActionResult UserReg(string uname, string phone, string pwd, int qq)
        {
            User user = new User()
            {
                UserName = uname,
                Tel      = phone,
                Password = DESEncrypt.Encrypt(pwd),
                QQ       = qq
            };
            int i = IocUtils.Resolve <IUserService>().Insert(user);

            if (i > 0)
            {
                return(Content("ok,恭喜:注册成功!"));
            }
            else
            {
                return(Content("no,提示:注册失败!"));
            }
        }
Esempio n. 12
0
        public ActionResult OutLogin()
        {
            string title = new OperatorProvider <FrontCurrentUser>().GetCurrent().UserAccount;

            if (string.IsNullOrEmpty(title))
            {
                return(RedirectToAction("Index", "Login"));
            }
            Log log = new Log()
            {
                Title = title,
                Msg   = "个人中心用户安全退出系统",
                IP    = Net.Ip
            };

            IocUtils.Resolve <ILogService>().Insert(log);
            Session.Abandon();
            Session.Clear();
            new OperatorProvider <FrontCurrentUser>().RemoveCurrent();
            return(RedirectToAction("Index", "Login"));
        }
Esempio n. 13
0
        /// <summary>
        /// 大神申请-游戏初步认证
        /// </summary>
        /// <returns></returns>
        public ActionResult MainToGameApply(int gameId, int ratingId, int areaId, string ratingImg)
        {
            R_Game_User_Play game = new R_Game_User_Play()
            {
                GameRating_CutImg = ratingImg,
                Type         = (int)ProjectType.Manito,
                User_UserId  = new OperatorProvider <FrontCurrentUser>().GetCurrent().UserId,
                Games_GameId = gameId,
                GameAreaId   = areaId,
                GameRatingId = ratingId
            };

            if (IocUtils.Resolve <IR_Game_User_PlayService>().Insert(game) > 0)
            {
                return(Content("ok"));
            }
            else
            {
                return(Content("no"));
            }
        }
 public R_Game_User_Play GetModel(int id = 1, string where = null)
 {
     return(IocUtils.Resolve <IR_Game_User_PlayRepository>().GetModel(id));
 }
Esempio n. 15
0
        public ActionResult UserLogin(string str, string pwd, string isCheck, string vcode)
        {
            if (string.IsNullOrEmpty(str))
            {
                return(Content("no,提示:请输入您的用户名或手机号!"));
            }
            if (string.IsNullOrEmpty(pwd))
            {
                return(Content("no,提示:请输入您的登录密码!"));
            }
            // 校验验证码
            var session = Session["user_vcode"].ToString() == null?"": Session["user_vcode"].ToString();

            if (string.IsNullOrEmpty(vcode) || session != vcode.ToString())
            {
                return(Content("no,提示:验证码错误!"));
            }
            string msg      = string.Empty;
            User   userInfo = null;
            Log    log      = new Log();

            if (IocUtils.Resolve <IUserService>().Login(str, pwd, out msg, out userInfo))
            {
                //添加当前用户
                FrontCurrentUser currentUser = new FrontCurrentUser()
                {
                    UserId          = userInfo.UserId,
                    UserAccount     = userInfo.UserName,
                    UserPwd         = userInfo.Password,
                    Last_Login_IP   = userInfo.Last_Login_IP,
                    Last_Login_Time = userInfo.Last_Login_Time,
                    Intro           = userInfo.Intro,
                    HomePage_Img    = userInfo.HomePage_Img,
                    HeadImg         = userInfo.HeadImg,
                    CurrentCity     = userInfo.CurrentCity,
                    LoginToken      = DESEncrypt.Encrypt(Guid.NewGuid().ToString())
                };
                OperatorProvider <FrontCurrentUser> provider = new OperatorProvider <FrontCurrentUser>();
                provider.AddCurrent(currentUser);
                //写日志
                log.Title = userInfo.UserName;
                log.Msg   = "个人中心用户登录成功";
                log.IP    = Net.Ip;
                IocUtils.Resolve <ILogService>().Insert(log);
                // Session["current_user"] = userInfo;
                if (!string.IsNullOrEmpty(isCheck))
                {
                    CookieHelper.SetCookie("sb1", userInfo.UserName, DateTime.Now.AddDays(7));
                    CookieHelper.SetCookie("sb2", DESEncrypt.Encrypt(userInfo.Password), DateTime.Now.AddDays(7));
                }
                return(Content(msg));
            }
            else
            {
                log.Title = userInfo.UserName;
                log.Msg   = "个人中心用户登录失败" + msg;
                log.IP    = Net.Ip;
                IocUtils.Resolve <ILogService>().Insert(log);
                return(Content(msg));
            }
        }
Esempio n. 16
0
 public bool Update(User entity)
 {
     return(IocUtils.Resolve <IUserRepository>().Update(entity));
 }
Esempio n. 17
0
 public string OutCode(string mobile, string vcode, string ip)
 {
     return(IocUtils.Resolve <IUserRepository>().OutCode(mobile, vcode, ip));
 }
Esempio n. 18
0
 public IEnumerable <Games> GetList()
 {
     return(IocUtils.Resolve <IGamesRepository>().GetList());
 }
Esempio n. 19
0
 public int Insert(User entity)
 {
     return(IocUtils.Resolve <IUserRepository>().Insert(entity));
 }
Esempio n. 20
0
 public bool UserInfoUpdate(User user)
 {
     return(IocUtils.Resolve <IUserRepository>().UserInfoUpdate(user) > 0?true:false);
 }
Esempio n. 21
0
 public User GetModel(int id = 1, string where = null)
 {
     return(IocUtils.Resolve <IUserRepository>().GetModel(name: where));
 }
Esempio n. 22
0
 public int Insert(Log entity)
 {
     return(IocUtils.Resolve <ILogRepository>().Insert(entity));
 }
Esempio n. 23
0
 public int UserMoney(int userId, bool state)
 {
     return(IocUtils.Resolve <IMoneyRepository>().UserMoney(userId, state));
 }
Esempio n. 24
0
        /// <summary>
        /// 大神申请
        /// </summary>
        /// <returns></returns>
        public ActionResult ManitoApply(int userId)
        {
            ViewData.Model = IocUtils.Resolve <IR_Game_User_PlayService>().GetModel(userId);

            return(View());
        }
 public int Insert(R_Game_User_Play entity)
 {
     return(IocUtils.Resolve <IR_Game_User_PlayRepository>().Insert(entity));
 }
Esempio n. 26
0
 public IList <Focus> GetFocusList(int userId, bool sign)
 {
     return(IocUtils.Resolve <IFocusRepository>().GetFocusList(userId, sign));
 }
 public bool InsertFunPlay(R_Game_User_Play entity, User user)
 {
     return(IocUtils.Resolve <IR_Game_User_PlayRepository>().InsertFunPlay(entity, user) > 0?true:false);
 }
Esempio n. 28
0
 public object GetGamesList()
 {
     return(IocUtils.Resolve <IGamesService>().GetList().ToJson());
 }
Esempio n. 29
0
 public IList <GameRating> GetList(int gameId)
 {
     return(IocUtils.Resolve <IGameRatingRepository>().GetList(gameId));
 }
Esempio n. 30
0
 public IList <Entity.GameAreaService> GetList(int gameId)
 {
     return(IocUtils.Resolve <IGameAreaServiceRepository>().GetList(gameId));
 }