Ejemplo n.º 1
0
        public ActionResult Purchase(PurchaseDto dto)
        {
            var model = new Purchase();

            model.City          = dto.City;
            model.Email         = dto.Email;
            model.Phone         = dto.Phone;
            model.PurchaseType  = dto.PurchaseType;
            model.SalePrice     = dto.SalePrice;
            model.SalesPersonId = dto.SalesPersonId;
            model.State         = dto.State;
            model.Street1       = dto.Street1;
            model.Street2       = dto.Street2;
            model.ZipCode       = dto.ZipCode;
            model.VehicleId     = dto.Id;

            model.PurchaseDate = DateTime.Today;

            purchaseRepository.Create(model);
            var vehicle = vehicleRepository.Get(dto.Id);

            vehicle.Sold = true;
            vehicleRepository.Update(vehicle);

            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult Specials(AddSpecialViewModel viewModel)
        {
            var special = new Special {
                Title = viewModel.Title, Description = viewModel.Description
            };

            specialRepo.Create(special);

            return(RedirectToAction("Specials"));
        }
Ejemplo n.º 3
0
        public ActionResult Models(AddVehicleModelViewModel viewModel)
        {
            var model = new VehicleModel {
                Description = viewModel.VehicleModelDescription, MakeId = viewModel.MakeId
            };

            modelRepo.Create(model);

            return(RedirectToAction("Models"));
        }
Ejemplo n.º 4
0
 public ActionResult AddVehicle(AddVehicleViewModel viewModel)
 {
     vehicleRepo.Create(viewModel.Vehicle);
     return(RedirectToAction("AddVehicle"));
 }
Ejemplo n.º 5
0
 public ActionResult Contact(ContactForm contactForm)
 {
     contactRepository.Create(contactForm);
     return(View());
 }