public ViewResult Register() { RegisterCinemaModel model = new RegisterCinemaModel(); //model.Cinema; model.CurrentUser = repository.GetUserById(User.Identity.GetUserId()); return(View("RegisterCinema", model)); }
public ActionResult Register(RegisterCinemaModel model) { AppUser user = repository.GetUserById(User.Identity.GetUserId()); if (user != null) { model.Cinema.Moderator = user; } repository.AddCinema(model.Cinema); UserManager.AddToRoleAsync(User.Identity.GetUserId(), "CinemaModerator"); return(RedirectToAction("ViewUser", "UserPage", new { userId = User.Identity.GetUserId() })); }