//User login action method public ActionResult UserLogin() { //【1】Receive data (encapsulate the received data as an object) User user = new User() { Account = Convert.ToString(Request.Params["account"]), Password = Convert.ToString(Request.Params["password"]) }; //【2】Business processing (call the background model, the realization of user information judgment) user = new UserServiceBLL().UserLogin(user); //【3】Return data (view, controller, others...) (jump) if (user.Nickname != null) { ViewData["info"] = "Welcome:" + user.Nickname; return(RedirectToAction("Index", "Doc")); } else { ViewData["info"] = "ERROR Incorrect username or password!"; } return(View("UserLogin")); }
public UserService(UserServiceBLL UserObj) { this.UserObj = UserObj; }