Ejemplo n.º 1
0
 public LoginVM Login(LoginFM login)
 {
     LoginVM userVM = null;
     UserDAO dao = new UserDAO();
     User user = dao.GetUserByEmail(login.Email);
     if(user != null && user.Password == login.Password)
     {
         userVM = new LoginVM();
         userVM.Email = user.Email;
         userVM.ID = user.ID;
     }
     return userVM;
 }
Ejemplo n.º 2
0
 public ActionResult Login(LoginFM credientials)
 {
     LoginVM user = new LoginService().Login(credientials);
     if(user != null)
     {
         Session["UserID"] = user.ID;
         return RedirectToAction("Index", "Home");
     }
     else
     {
         ViewBag.ErrorMessage = "Username or Password incorrect.";
         return View("Index");
     }
 }