Пример #1
0
        public IActionResult Add(AddVenueViewModel model)
        {
            var venue = new Venue
            {
                Description = model.Description
            };

            _venueService.AddVenue(venue);

            return(View("Index", new VenueListViewModel {
                VenueList = _venueService.GetVenues().ToList()
            }));
        }
Пример #2
0
 public IActionResult Add(AddVenueViewModel addVenueViewModel)
 {
     if (ModelState.IsValid)
     {
         Venue newVenue = new Venue
         {
             Name = addVenueViewModel.Name,
             Capacity = addVenueViewModel.Capacity,
             Price = addVenueViewModel.Price
         };
         context.Add(newVenue);
         context.SaveChanges();
         return Redirect("/Venue/ViewVenue/" + newVenue.ID);
     }
     return View(addVenueViewModel);
 }
Пример #3
0
 public IActionResult Add()
 {
     AddVenueViewModel addVenueViewModel = new AddVenueViewModel();
     return View(addVenueViewModel);
 }