コード例 #1
0
        public IActionResult Consulta(string filtro)
        {
            var lista = new List <Funcionario>();

            try
            {
                var funcionarioRepository  = new FuncionarioRepository();
                var cargoRepository        = new CargoRepository();
                var departamentoRepository = new DepartamentoRepository();

                lista = funcionarioRepository.ConsultarPorNome(filtro);

                foreach (var item in lista)
                {
                    item.Cargo        = cargoRepository.ObterPorId(item.IdCargo);
                    item.Departamento = departamentoRepository.ObterPorId(item.IdDepartamento);
                }
            }
            catch (Exception e)
            {
                TempData["Mensagem"] = e.Message;
            }

            return(View(lista));
        }
コード例 #2
0
 public ReportPusher(ReportSubmission reportSubmission,
                     CargoRepository cargoRepository,
                     HandlingEventRepository handlingEventRepository)
 {
     this.reportSubmission = reportSubmission;
     this.cargoRepository = cargoRepository;
     this.handlingEventRepository = handlingEventRepository;
 }
コード例 #3
0
 public CargoUpdater(SystemEvents systemEvents,
                     CargoRepository cargoRepository,
                     HandlingEventRepository handlingEventRepository)
 {
     this.systemEvents = systemEvents;
     this.cargoRepository = cargoRepository;
     this.handlingEventRepository = handlingEventRepository;
 }
コード例 #4
0
 public void setUp()
 {
     cargoRepository = MockRepository.GenerateMock<CargoRepository>();
     locationRepository = MockRepository.GenerateMock<LocationRepository>();
     routingService = MockRepository.GenerateMock<RoutingService>();
     trackingIdFactory = MockRepository.GenerateMock<TrackingIdFactory>();
     bookingService = new BookingServiceImpl(routingService, trackingIdFactory, cargoRepository, locationRepository);
 }
コード例 #5
0
 public void setUp()
 {
     cargoRepository    = MockRepository.GenerateMock <CargoRepository>();
     locationRepository = MockRepository.GenerateMock <LocationRepository>();
     routingService     = MockRepository.GenerateMock <RoutingService>();
     trackingIdFactory  = MockRepository.GenerateMock <TrackingIdFactory>();
     bookingService     = new BookingServiceImpl(routingService, trackingIdFactory, cargoRepository, locationRepository);
 }
コード例 #6
0
 public HandlingEventFactory(CargoRepository cargoRepository,
                             VoyageRepository voyageRepository,
                             LocationRepository locationRepository)
 {
     this.cargoRepository = cargoRepository;
     this.voyageRepository = voyageRepository;
     this.locationRepository = locationRepository;
 }
コード例 #7
0
 public BookingServiceFacadeImpl(BookingService bookingService, LocationRepository locationRepository,
                                 CargoRepository cargoRepository, VoyageRepository voyageRepository)
 {
     this.bookingService = bookingService;
     this.locationRepository = locationRepository;
     this.cargoRepository = cargoRepository;
     this.voyageRepository = voyageRepository;
 }
コード例 #8
0
 public HomeController(UserManager <ApplicationUser> userManager,
                       IRepository <ApplicationUser> userRepository,
                       IRepository <Car> carRepository,
                       IRepository <Cargo> cargoRepository)
 {
     _userManager     = userManager;
     _userRepository  = (UserRepository)userRepository;
     _carRepository   = (CarRepository)carRepository;
     _cargoRepository = (CargoRepository)cargoRepository;
 }
コード例 #9
0
 public CargoController(IRepository <Cargo> cargoRepository,
                        UserManager <ApplicationUser> userManager,
                        IRepository <Group> groupRepository,
                        IFileManager fileManager)
 {
     _cargoRepository = (CargoRepository)cargoRepository;
     _userManager     = userManager;
     _fileManager     = fileManager;
     _groupRepository = (GroupRepository)groupRepository;
 }
コード例 #10
0
 public BookingServiceImpl(RoutingService routingService,
                       TrackingIdFactory trackingIdFactory,
                       CargoRepository cargoRepository,
                       LocationRepository locationRepository)
 {
     _routingService = routingService;
     _trackingIdFactory = trackingIdFactory;
     _cargoRepository = cargoRepository;
     _locationRepository = locationRepository;
 }
コード例 #11
0
        protected void setUp()
        {
            cargoRepository = MockRepository.GenerateMock<CargoRepository>();
            voyageRepository = new VoyageRepositoryInMem();
            locationRepository = new LocationRepositoryInMem();
            factory = new HandlingEventFactory(cargoRepository, voyageRepository, locationRepository);

            trackingId = new TrackingId("ABC");
            RouteSpecification routeSpecification = new RouteSpecification(L.TOKYO, L.HELSINKI, DateTime.Now);
            cargo = new Cargo(trackingId, routeSpecification);
        }
コード例 #12
0
 public void setUp()
 {
     systemEvents = MockRepository.GenerateMock<SystemEvents>();
     cargoRepository = new CargoRepositoryInMem();
     handlingEventRepository = new HandlingEventRepositoryInMem();
     locationRepository = new LocationRepositoryInMem();
     voyageRepository = new VoyageRepositoryInMem();
     trackingIdFactory = new TrackingIdFactoryInMem();
     handlingEventFactory = new HandlingEventFactory(cargoRepository, voyageRepository, locationRepository);
     cargoUpdater = new CargoUpdater(systemEvents, cargoRepository, handlingEventRepository);
 }
コード例 #13
0
        public CargoRepositoryTestSuite()
        {
            APIManagerMock     = new Mock <IAPIManager>();
            MappingServiceMock = new Mock <IMappingService>();
            CargoRepository    = new CargoRepository(APIManagerMock.Object, MappingServiceMock.Object);

            CargoAPIMock = new Mock <ICargoAPI>();

            APIManagerMock
            .Setup(m => m.Get <ICargoAPI>((External.Models.Models.RequestPriority)RequestPriority.UserInitiated))
            .Returns(CargoAPIMock.Object);
        }
コード例 #14
0
        protected void setUp()
        {
            cargoRepository    = MockRepository.GenerateMock <CargoRepository>();
            voyageRepository   = new VoyageRepositoryInMem();
            locationRepository = new LocationRepositoryInMem();
            factory            = new HandlingEventFactory(cargoRepository, voyageRepository, locationRepository);

            trackingId = new TrackingId("ABC");
            RouteSpecification routeSpecification = new RouteSpecification(L.TOKYO, L.HELSINKI, DateTime.Now);

            cargo = new Cargo(trackingId, routeSpecification);
        }
コード例 #15
0
        protected void setUp()
        {
            cargoRepository = MockRepository.GenerateMock<CargoRepository>();
            voyageRepository = MockRepository.GenerateMock<VoyageRepository>();
            handlingEventRepository = MockRepository.GenerateMock<HandlingEventRepository>();
            locationRepository = MockRepository.GenerateMock<LocationRepository>();
            systemEvents = MockRepository.GenerateMock<SystemEvents>();

            HandlingEventFactory handlingEventFactory = new HandlingEventFactory(cargoRepository,
                voyageRepository,
                locationRepository);
            service = new HandlingEventServiceImpl(handlingEventRepository, systemEvents, handlingEventFactory);
        }
コード例 #16
0
        protected void setUp()
        {
            cargoRepository         = MockRepository.GenerateMock <CargoRepository>();
            voyageRepository        = MockRepository.GenerateMock <VoyageRepository>();
            handlingEventRepository = MockRepository.GenerateMock <HandlingEventRepository>();
            locationRepository      = MockRepository.GenerateMock <LocationRepository>();
            systemEvents            = MockRepository.GenerateMock <SystemEvents>();

            HandlingEventFactory handlingEventFactory = new HandlingEventFactory(cargoRepository,
                                                                                 voyageRepository,
                                                                                 locationRepository);

            service = new HandlingEventServiceImpl(handlingEventRepository, systemEvents, handlingEventFactory);
        }
コード例 #17
0
 public TrackingController(CargoRepository cargoRepository, HandlingEventRepository handlingEventRepository)
 {
     _cargoRepository = cargoRepository;
     _handlingEventRepository = handlingEventRepository;
 }
コード例 #18
0
 public ItineraryUpdater(VoyageRepository voyageRepository, CargoRepository cargoRepository)
 {
     this.voyageRepository = voyageRepository;
     this.cargoRepository = cargoRepository;
 }
コード例 #19
0
 public CargoService()
 {
     Repository = new CargoRepository();
 }
コード例 #20
0
 public ReadyToClaimNotifier(CargoRepository cargoRepository)
 {
     this.cargoRepository = cargoRepository;
 }
コード例 #21
0
 public MisdirectedNotifier(CargoRepository cargoRepository)
 {
     this.cargoRepository = cargoRepository;
 }