Esempio n. 1
0
        public ActionResult Specials()
        {
            var repo = MiscRepoFactory.CreateMiscRepo();

            List <Specials> specials = repo.GetSpecials();

            return(View(specials));
        }
Esempio n. 2
0
        public ActionResult Index()
        {
            var vehicleRepo = VehicleRepoFactory.CreateVehicleRepo();
            var miscRepo    = MiscRepoFactory.CreateMiscRepo();

            HomeVM homeVM = new HomeVM();

            homeVM.Vehicles = vehicleRepo.GetFeaturedVehicles();
            homeVM.Specials = miscRepo.GetSpecials();

            return(View(homeVM));
        }
Esempio n. 3
0
        public ActionResult Contact(ContactVM message)
        {
            var     repo           = MiscRepoFactory.CreateMiscRepo();
            Contact contactMessage = new Contact();

            if (ModelState.IsValid)
            {
                contactMessage.ContactName = message.ContactName;
                contactMessage.Email       = message.Email;
                contactMessage.Phone       = message.Phone;
                contactMessage.Message     = message.Message;

                repo.InsertMessage(contactMessage);

                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                return(View(message));
            }
        }