Esempio n. 1
0
        public ActionResult Details(int id)
        {
            var model = EventsService.GetInstance().GetEvent(id);

            if (model == null)
            {
                return(RedirectToAction("Index"));
            }
            return(View("Details", model));
        }
Esempio n. 2
0
        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"));
        }
Esempio n. 3
0
 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();
 }
Esempio n. 4
0
        public ActionResult Index()
        {
            var events = EventsService.GetInstance().GetEvents();

            return(View(events));
        }