public ActionResult Index(loginModel model) { if (ModelState.IsValid) { if (DataAccess.DAL.UserIsValid(model.Username, model.Password)) { FormsAuthentication.SetAuthCookie(model.Username, false); if (DataAccess.DAL.Position("manager", model.Username)) { return(RedirectToAction("index", "Calendar")); } else { return(RedirectToAction("index", "User")); } } { ModelState.AddModelError("", "invalid username or password"); } } return(View()); }
public ActionResult Index(loginModel model) { return(View()); }