Esempio n. 1
0
        public ActionResult DeleteSpecial(int id)
        {
            ISpecialRepository repo = RepoFactory.CreateSpecialRepo();

            repo.Delete(id);
            return(RedirectToAction("Specials"));
        }
Esempio n. 2
0
        public ActionResult Specials()
        {
            ISpecialRepository repo = RepoFactory.CreateSpecialRepo();
            var model = repo.GetAll().ToList();

            return(View(model));
        }
Esempio n. 3
0
        public ActionResult Specials()
        {
            ISpecialRepository repo = RepoFactory.CreateSpecialRepo();

            AdminSpecialViewModel model = new AdminSpecialViewModel()
            {
                Specials = repo.GetAll().ToList()
            };

            return(View(model));
        }
Esempio n. 4
0
 public ActionResult Specials(AdminSpecialViewModel model)
 {
     if (ModelState.IsValid)
     {
         ISpecialRepository repo    = RepoFactory.CreateSpecialRepo();
         Special            special = new Special()
         {
             Description = model.Description,
             Title       = model.Title
         };
         repo.Create(special);
         return(RedirectToAction("Specials"));
     }
     return(View(model));
 }
Esempio n. 5
0
        public ActionResult Index()
        {
            ISpecialRepository special_repo = RepoFactory.CreateSpecialRepo();
            IVehicleRepository vehicle_repo = RepoFactory.CreateVehicleRepo();


            var indexView = new HomeIndexViewModel()
            {
                specials         = special_repo.GetAll().ToList(),
                featuredVehicles = vehicle_repo.GetAllFeatures()
            };

            foreach (var v in indexView.featuredVehicles.features)
            {
                v.VehicleImagePath = ImageFinder(v.VehicleId);
            }
            return(View(indexView));
        }