Beispiel #1
0
        public ActionResult Details(int id)
        {
            var model = HousingService.GetInstance().GetHouse(id);

            if (model == null)
            {
                return(RedirectToAction("Index"));
            }
            return(View("Details", model));
        }
Beispiel #2
0
        public ActionResult AddHouse(HousingViewModel model)
        {
            var user = UserService.GetInstance().GetUser();

            model.CreatedAt = DateTime.Now;
            model.CreatedBy = user;

            HousingService.GetInstance().CreateHouse(model);

            return(RedirectToAction("Index"));
        }
Beispiel #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();
 }
Beispiel #4
0
        public ActionResult Index()
        {
            var houses = HousingService.GetInstance().GetHouses();

            return(View(houses));
        }