public FlightLogsController(IApplicationSettings applicationSettings, 
                             IFlightLogRepository flightLogRepository,
                             IFlightProgramsRepository flightProgramsRepository)
     :base(applicationSettings, flightLogRepository)
 {
     this.flightLogRepository = flightLogRepository;
     this.flightProgramsRepository = flightProgramsRepository;
 }
Beispiel #2
0
 public FlightLogsController(IApplicationSettings applicationSettings,
                             IFlightLogRepository flightLogRepository,
                             IFlightProgramsRepository flightProgramsRepository)
     : base(applicationSettings, flightLogRepository)
 {
     this.flightLogRepository      = flightLogRepository;
     this.flightProgramsRepository = flightProgramsRepository;
 }
Beispiel #3
0
 public DepartmentAPIController(IDepartmentRepository departmentRepository, ApplicationDbContext context,
                                IOrganizationRepository organizationRepository, IEntityRepository entityRepository, IComponentRepository componentRepository, IDepartmentApplicationUserRepository departmentApplicationUserRepository, IFlightLogRepository flightLogRepository,
                                UserManager <ApplicationUser> userManager)
 {
     _departmentRepository = departmentRepository;
     _context                = context;
     _userManager            = userManager;
     _organizationRepository = organizationRepository;
     _entityRepository       = entityRepository;
     _componentRepository    = componentRepository;
     _departmentApplicationUserRepository = departmentApplicationUserRepository;
     _flightLogRepository = flightLogRepository;
 }
 public FlightLogAPIController(IFlightLogRepository repository, IEntityRepository entityRepository, IComponentRepository componentRepository)
 {
     this.repository          = repository;
     this.entityRepository    = entityRepository;
     this.componentRepository = componentRepository;
 }
Beispiel #5
0
        public async Task <List <EntityViewModel> > GetViewModelsInDepartment(int departmentId, IComponentRepository componentRepository, IFlightLogRepository flightLogRepository)
        {
            var entityList = await _db.Entities
                             .Where(x => x.DepartmentId == departmentId)
                             .Select(x => x.EntityId)
                             .ToListAsync();

            var entityViewModels = new List <EntityViewModel>();

            foreach (var viewModel in entityList.Select(entityId => GetViewModel(entityId).Result))
            {
                viewModel.Components = componentRepository.AllInEntityViewModel(viewModel.EntityId).Result;
                viewModel.FlightLogs = flightLogRepository.GetViewModelsInEntity(viewModel.EntityId).Result;
                entityViewModels.Add(viewModel);
            }
            return(entityViewModels);
        }