Exemplo n.º 1
0
 public ActionResult LogOut()
 {
     Session.Abandon();
     FormsAuthentication.SignOut();
     AccountModel.LogOnModel objLogin = new AccountModel.LogOnModel();
     return(View("Login", objLogin));
 }
Exemplo n.º 2
0
 public ActionResult Login(FormCollection frmItem)
 {
     AccountModel.LogOnModel objLoginModel = new AccountModel.LogOnModel();
     if (ModelState.IsValid)
     {
         if (Membership.ValidateUser(frmItem["txtUserName"], frmItem["txtPassword"]))
         {
             FormsAuthentication.SetAuthCookie(frmItem["txtUserName"], false);
             SessionManager.DisplayName = frmItem["txtUserName"];
             return(RedirectToAction("Dashboard", "Home"));
         }
         else
         {
             ModelState.AddModelError("LoginInvalid", "The user name or password provided is incorrect.");
         }
     }
     // If we got this far, something failed, redisplay form
     return(View(objLoginModel));
 }
Exemplo n.º 3
0
 public ActionResult Login()
 {
     AccountModel.LogOnModel objLogin = new AccountModel.LogOnModel();
     return(View(objLogin));
 }