Beispiel #1
0
        public ActionResult MaintenanceDetails(int maintenanceId)
        {
            var maintenance = maintenanceRepository.Get(maintenanceId);
            var car         = carRepository.Get(maintenance.CarId);
            var customer    = customerRepository.Get(maintenance.CustomerId);
            var master      = masterRepository.Get(maintenance.MasterId.Value);
            var model       = new MaintanceDetailsViewModel
            {
                Car             = car,
                CustomerName    = customer.Name,
                CustomerSurname = customer.Surname,
                Master          = master,
                DateTime        = maintenance.DateTime
            };

            return(View(model));
        }
Beispiel #2
0
        public ActionResult MaintenanceDetails(int maintenanceId, double markUp)
        {
            var maintenance = maintenanceRepository.Get(maintenanceId);

            maintenance.Price += markUp;
            maintenanceRepository.Update(maintenance);
            var car      = carRepository.Get(maintenance.CarId);
            var customer = customerRepository.Get(maintenance.CustomerId);
            var model    = new MaintanceDetailsViewModel
            {
                Car             = car,
                CustomerName    = customer.Name,
                CustomerSurname = customer.Surname,
                DateTime        = maintenance.DateTime,
                Price           = maintenance.Price
            };

            return(View(model));
        }