public ActionResult AddKindergarten(AddKindergartenViewModel model)
 {
     if (User.Identity.IsAuthenticated && User.IsInRole("Admin"))
     {
         if (ModelState.IsValid)
         {
             var user = new ApplicationUser {
                 UserName = model.Email, Email = model.Email
             };
             string password = Guid.NewGuid().ToString("N");
             if (ApplicationManager.IsEmailExist(model.Email))
             {
                 ModelState.AddModelError("Email", "Такий емейл вже використовується");
                 return(View(model));
             }
             else
             {
                 var result = UserManager.Create(user, password);
                 if (result.Succeeded)
                 {
                     KindergartenManager.AddKindergarten(model, user.Id, Server);
                     UserManager.AddToRole(user.Id, "Administrator");
                     MailCustom.Mail(model.Email, "IStudy password", GetAnswer(model.Email, password));
                     return(RedirectToAction("Kindergartens", "Admin"));
                 }
                 AddErrors(result);
             }
         }
         return(View(model));
     }
     return(RedirectToAction("Index", "Home"));
 }