public ActionResult Authorization(AuthorizationUser authorUser)
 {
     if (ModelState.IsValid)
     {
         DAOImplements      DAOImpl = new DAOImplements();
         List <RegistrUser> user    = DAOImpl.GetAllUser();
         for (int i = 0; i < user.Count; i++)
         {
             if (authorUser.Login.Equals(user[i].Login) && authorUser.Password.Equals(user[i].Password))
             {
                 Session["user"] = user[i];
                 return(RedirectToAction("Index", "Home"));
             }
         }
         ViewBag.ErrorMassage    = "User with such login or does not exist, or password is incorrectly entered";
         ViewBag.validation      = "validationSummaryHide";
         ViewBag.validationLogin = "******";
         return(View(authorUser));
     }
     ViewBag.validation      = "validationSummaryShow";
     ViewBag.validationLogin = "******";
     return(View(authorUser));
 }
 public ActionResult Registration(RegistrUser regUser)
 {
     if (ModelState.IsValid)
     {
         DAOImplements      DAOImpl = new DAOImplements();
         List <RegistrUser> user    = DAOImpl.GetAllUser();
         for (int i = 0; i < user.Count; i++)
         {
             if (regUser.Login.Equals(user[i].Login) || regUser.Email.Equals(user[i].Email))
             {
                 ViewBag.ErrorMassage    = "User with such login or e-mail already exists";
                 ViewBag.validation      = "validationSummaryHide";
                 ViewBag.validationLogin = "******";
                 return(View("Registration", regUser));
             }
         }
         DAOImpl.SaveUser(regUser.Login, regUser.Password, regUser.Email, regUser.Gender, regUser.Year, regUser.Day, regUser.Months, regUser.Name, regUser.Surename);
         return(View("WelcomePage"));
     }
     ViewBag.validation      = "validationSummaryShow";
     ViewBag.validationLogin = "******";
     return(View("Registration", regUser));
 }