public ActionResult Index(User user)
        {
            LoginModel model = new LoginModel {
                IsValid = ModelState.IsValid
            };

            Response response = _loginData.LoginControl(user);

            if (response.IsSuccess)
            {
                Session[Constants.SessionInformation] = (User)response.Data[0];

                return(RedirectToAction("Index", "Home"));
            }

            model.IsValid      = false;
            model.ErrorMessage = response.ErrorMessage;

            return(View(model));
        }
Example #2
0
 public Response LoginControl(User user)
 {
     return(_loginData.LoginControl(user));
 }