public ActionResult Details(int id) { var model = EventsService.GetInstance().GetEvent(id); if (model == null) { return(RedirectToAction("Index")); } return(View("Details", model)); }
public ActionResult AddEvent(EventViewModel model) { var user = UserService.GetInstance().GetUser(); model.CreatedBy = user; model.CreatedAt = DateTime.Now; model.Time = DateTime.Now; EventsService.GetInstance().CreateEvent(model); return(RedirectToAction("Index")); }
void Application_Start(object sender, EventArgs e) { // Code that runs on application startup AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); RouteConfig.RegisterRoutes(RouteTable.Routes); //INITIALIZE SERVICES UserService.GetInstance(); EventsService.GetInstance(); WorkService.GetInstance(); HousingService.GetInstance(); FoodService.GetInstance(); }
public ActionResult Index() { var events = EventsService.GetInstance().GetEvents(); return(View(events)); }