Esempio n. 1
0
        public ActionResult Login(LoginModel model)
        {
            if(_user.IsUserExist(model))
            {
                return RedirectToAction("Index", "Home");
            }
            ViewBag.Message = "User doesn't exist";
            return View();

        }
Esempio n. 2
0
 public bool IsUserExist(LoginModel model)
  {
      try
      {
          if (this.entities.Users.FirstOrDefault(x => x.Email == model.Email && x.Password == model.Password) == null)
          {
              return false;
          }
          else
          {
              return true;
          }
      }
      catch
      {
          return false;
      }
  }