public async Task <IActionResult> CreateVenue(VenueCreateViewModel model) { if (ModelState.IsValid) { var venue = new Venue { Name = model.Name, Adress = model.Adress, CityId = model.CityId, }; await venueService.Save(venue); return(RedirectToAction("Venue/GetVenueList")); } return(RedirectToAction("Venue/CreateVenue")); }
public ActionResult Create(VenueCreateViewModel model) { if (ModelState.IsValid) { var input = MapperManager.Map <VenueDto>(model); try { var result = _venueManagementService.CreateVenue(input); if (result.Id > 0) { return(RedirectToAction("Index", "Venue")); } } catch (NotUniqueException) { ModelState.AddModelError("NotUnique", LanguageSummary.DescriptionNotUnique); } } return(View(model)); }
public ActionResult Create() { var model = new VenueCreateViewModel(); return(View(model)); }