public ActionResult Delete(EventsDeleteViewModel model) { EventRepository repository = new EventRepository(); if (model.Id.ToString() != String.Empty) { repository.Delete(model.Id); } return(RedirectToAction("Index")); }
public ActionResult Create(EventsDeleteViewModel model, int id) { EventRepository repository = new EventRepository(); Event events = repository.GetById(id); model.ImgURL = events.ImgURL; model.Title = events.Title; model.EventDate = events.EventDate; model.EventPlace = events.EventPlace; model.Organizer = events.Organizer; model.Description = events.Description; return(View(model)); }
public ActionResult Delete(int id) { TicketRepository ticketRepository = new TicketRepository(); Ticket tickets = ticketRepository.GetById(id); EventRepository repository = new EventRepository(); Event events = repository.GetById(tickets.EventId); EventsDeleteViewModel model = new EventsDeleteViewModel(); model.ImgURL = events.ImgURL; model.Title = events.Title; model.EventDate = events.EventDate; model.EventPlace = events.EventPlace; model.Organizer = events.Organizer; model.Description = events.Description; return(View(model)); }