public ActionResult Login(WorkshopLoginModel objCustmerLoginModel) { ActionResult result = View(); if (ModelState.IsValid) { var currentUser = objMechAppProjectEntities.Customers.FirstOrDefault(x => x.Login == objCustmerLoginModel.Login && x.Password == objCustmerLoginModel.Password); if (currentUser != null) { Session["Login"] = new SessionModel() { UserId = currentUser.CustomerId, UserLogin = currentUser.Login }; result = RedirectToAction("Index", "Home"); } else { ModelState.AddModelError("Error", "Login i haslo nie są poprawne"); result = View("Login"); } } return(result); }
public ActionResult Login() { WorkshopLoginModel objCustmerLoginModel = new WorkshopLoginModel(); return(View(objCustmerLoginModel)); }
public ActionResult LoginWorkshop() { WorkshopLoginModel objWorkshopLoginModel = new WorkshopLoginModel(); return(View(objWorkshopLoginModel)); }