예제 #1
0
        public JsonResult Login(string username, string psd)
        {
            UserInfoN userInfoN = _userInfoService.Login(username, psd);

            if (userInfoN == null)
            {
                return(JsonResult(false, null, "登录失败"));
            }
            return(JsonResult(true, null, "登陆成功"));
        }
예제 #2
0
        public ActionResult Register(string userName, string passWord)
        {
            UserInfoN user = _userInfoService.Register(userName, passWord);

            if (user == null)
            {
                return(RedirectToAction("Register", new { }));
            }
            return(RedirectToAction("Login"));
        }
예제 #3
0
        public UserInfoN Login(string userName, string passWord)
        {
            UserInfoN userInfoN = _userInforepository.Table
                                  .Where(p => p.UserName == userName && p.PassWord == passWord)
                                  .FirstOrDefault();

            /*IList<UserInfoN> userInfoN = _userInforepository.Table
             *  .Where(p => p.UserName == userName && p.PassWord == passWord)
             *  .ToList();*/
            return(userInfoN);
        }
예제 #4
0
        //注册方法
        public UserInfoN Register(string userName, string passWord)
        {
            UserInfoN userInfo = null;

            if (!String.IsNullOrEmpty(userName) && !String.IsNullOrEmpty(passWord))
            {
                userInfo = new UserInfoN {
                    UserName = userName, PassWord = passWord
                };
                _userInforepository.Create(userInfo);
            }

            return(userInfo);
        }