public ActionResult Authorize(Client client) { if (adminRepository.Authorize(client.Login, client.Password) != null) { return(RedirectToAction("WorkMenu", "Admin")); } var authorizedClient = accountRepository.Authorize(client.Login, client.Password); if (authorizedClient == null) { Session["IsAuthorized"] = "Проверьте логин или пароль"; return(RedirectToAction("AuthorizeIndex", "Account")); } Session["IdClient"] = authorizedClient.IdClient; return(RedirectToAction("Index", "Meals")); }