Exemple #1
0
 public ActionResult Registration(RegisterTag registerTag)
 {
     if (ModelState.IsValid)
     {
         var geocode = registerTag.City + ", " + registerTag.Street + ", " + registerTag.Home;
         _rentService.AddLongAndLatiByAddress(geocode, registerTag);
         if (!_rentService.RegistrationCreateUser(registerTag))
         {
             ModelState.AddModelError("Email", "Пользователь с таким email уже существует");
             return(View(registerTag));
         }
         FormsAuthentication.SignOut();
         FormsAuthentication.SetAuthCookie(registerTag.Email, true);
         return(RedirectToAction("Browse_item", "Rent"));
     }
     else
     {
         return(View(registerTag));
     }
 }