public ActionResult Login(Models.User user) { if (ModelState.IsValid) { var password = Utils.Utils.GetMd5(user.Password); var model = _userService.QuerySingle(u => u.UserName == user.UserName && u.Password == password); if (null != model) { Session["CurrentUser"] = model; return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "用户名或密码错误!"); } } return(View(user)); }
public ActionResult Edit(Guid id) { var book = _bookService.QuerySingle(b => b.Id == id); return(View(book)); }