Esempio n. 1
0
        public IList <MechanicGridViewModel> GetAll()
        {
            _unitOfWork.BeginTransaction();

            var allMechanics          = _mechanicRepository.GetAll();
            var allMechanicsViewModel = allMechanics.Select(x => x.MapToGridViewModel()).ToList();

            _unitOfWork.Commit();

            return(allMechanicsViewModel);
        }
        // GET: Appointments/Create     //Create com o syncfusion
        public IActionResult Create()
        {
            var unconfirmedAppointments = _appointmentRepository.GetAll().Include(v => v.Vehicle)
                                          .Include(c => c.Client)
                                          .Include(m => m.Mechanic)
                                          .ThenInclude(c => c.Specialty)
                                          .Where(p => p.IsConfirmed != true);



            var model = new AppointmentViewModel
            {
                Vehicles                = _vehicleRepository.GetAll().ToList(),
                AppointmentTypes        = _appointmentTypeRepository.GetAll().ToList(),
                Appointments            = _appointmentRepository.GetAll().Where(m => m.IsConfirmed == true).ToList(),
                Mechanics               = _mechanicRepository.GetAll().ToList(),
                Clients                 = _clientRepository.GetAll().ToList(),
                UnconfirmedAppointments = unconfirmedAppointments,
                MechanicsCombo          = _mechanicRepository.GetComboMecanics()
            };

            return(View(model));
        }
 public int GetLastCode()
 {
     return(_mechanicRepository.GetAll().Count() > 0 ? _mechanicRepository.GetAll().Max(m => m.Id) + 1 : 1);
 }
 public IActionResult ssIndex()
 {
     return(View(_mechanicRepository.GetAll().Include(u => u.Specialty)));
 }