예제 #1
0
        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"));
        }
예제 #2
0
        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));
        }
예제 #3
0
        public ActionResult Create()
        {
            var model = new VenueCreateViewModel();

            return(View(model));
        }