public ActionResult Index() { var events = _repositoryTicketServices.GetAllEvents(); ViewBag.Events = events; return(View()); }
public ActionResult EventComingSoon() { ViewBag.Title = "Events"; var events = _repositoryTicketServices.GetAllEvents() .Where(p => p.EventDate >= DateTime.Now.Add(new TimeSpan(14, 0, 0, 0))); var viewModel = from e in events select new EventViewModel { EventId = e.EventId, EventName = e.EventName, EventDate = ((DateTime)e.EventDate).ToString("dd/MM/yyyy HH:mm", new CultureInfo("en-GB")), Location = e.Location }; return(View(viewModel)); }