Beispiel #1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_carrierRepository != null)
                {
                    _carrierRepository.Dispose();
                    _carrierRepository = null;
                }

                if (_destinationRepository != null)
                {
                    _destinationRepository.Dispose();
                    _destinationRepository = null;
                }

                if (_portRepository != null)
                {
                    _portRepository.Dispose();
                    _portRepository = null;
                }

                if (_vesselRepository != null)
                {
                    _vesselRepository.Dispose();
                    _vesselRepository = null;
                }
            }

            base.Dispose(disposing);
        }
 public CollectionPreparationHandler(string collectionName, IDestinationRepository destination, ISourceRepository source, ILogger logger)
 {
     _collectionName = collectionName;
     _destination    = destination;
     _source         = source;
     _logger         = logger;
 }
Beispiel #3
0
 public ShipmentController()
 {
     _carrierRepository     = new CarrierRepository();
     _destinationRepository = new DestinationRepository();
     _portRepository        = new PortRepository();
     _vesselRepository      = new VesselRepository();
 }
Beispiel #4
0
 public PartController()
 {
     _projectRepository                 = new ProjectRepository();
     _customerDynamicsRepository        = new CustomerDynamicsRepository();
     _customerAddressDynamicsRepository = new CustomerAddressDynamicsRepository();
     _foundryDynamicsRepository         = new FoundryDynamicsRepository();
     _shipmentTermRepository            = new ShipmentTermRepository();
     _materialRepository                = new MaterialRepository();
     _coatingTypeRepository             = new CoatingTypeRepository();
     _specificationMaterialRepository   = new SpecificationMaterialRepository();
     _projectPartRepository             = new ProjectPartRepository();
     _priceSheetRepository              = new PriceSheetRepository();
     _partRepository            = new PartRepository();
     _partDynamicsRepository    = new PartDynamicsRepository();
     _htsNumberRepository       = new HtsNumberRepository();
     _partStatusRepository      = new PartStatusRepository();
     _partTypeRepository        = new PartTypeRepository();
     _paymentTermRepository     = new PaymentTermRepository();
     _surchargeRepository       = new SurchargeRepository();
     _siteDynamicsRepository    = new SiteDynamicsRepository();
     _patternMaterialRepository = new PatternMaterialRepository();
     _destinationRepository     = new DestinationRepository();
     _foundryOrderRepository    = new FoundryOrderRepository();
     _customerOrderRepository   = new CustomerOrderRepository();
     _accountCodeRepository     = new AccountCodeRepository();
 }
 public OrderViewDataBuilder(IOriginRepository originRepository,
                             IDestinationRepository destinationRepository,
                             IPackageTypeSelectListBuilder packageTypeSelectListBuilder)
 {
     _originRepository             = originRepository;
     _destinationRepository        = destinationRepository;
     _packageTypeSelectListBuilder = packageTypeSelectListBuilder;
 }
 public OrderViewDataBuilder(IOriginRepository originRepository,
                             IDestinationRepository destinationRepository,
                             IPackageTypeSelectListBuilder packageTypeSelectListBuilder)
 {
     _originRepository = originRepository;
     _destinationRepository = destinationRepository;
     _packageTypeSelectListBuilder = packageTypeSelectListBuilder;
 }
Beispiel #7
0
 public Services.TripSearchRequest ToService(IDestinationRepository repo)
 {
     return(new TripSearchRequest(
                // TODO Refactor
                repo.FindByName(StartLocation).FirstOrNone().ValueOr((Domain.Destination)null),
                repo.FindByName(EndLocation).FirstOrNone().ValueOr((Domain.Destination)null),
                StartTime
                ));
 }
 public AccountController(IUserHelper userHelper, IConfiguration configuration, IMailHelper mailHelper, ICountryRepository countryRepository, ITicketRepository ticketRepository, IFlightRepository flightRepository, IDestinationRepository destinationRepository)
 {
     _userHelper            = userHelper;
     _configuration         = configuration;
     _mailHelper            = mailHelper;
     _countryRepository     = countryRepository;
     _ticketRepository      = ticketRepository;
     _flightRepository      = flightRepository;
     _destinationRepository = destinationRepository;
 }
Beispiel #9
0
 public ShipmentController(ICarrierRepository carrierRepository,
                           IDestinationRepository destinationRepository,
                           IPortRepository portRepository,
                           IVesselRepository vesselRepository)
 {
     _carrierRepository     = carrierRepository;
     _destinationRepository = destinationRepository;
     _portRepository        = portRepository;
     _vesselRepository      = vesselRepository;
 }
Beispiel #10
0
 public HomeController(IFlightRepository flightRepository, ITicketRepository ticketRepository, IDestinationRepository destinationRepository, IUserHelper userHelper, IMailHelper mailHelper)
 {
     // Actualizar o estado dos voos
     // Chamar todos os voos activos e aqueles cuja data de chegada seja menor que a data actual passá-los para Concluded
     flightRepository.UpdateFlightStatus(DateTime.Now);
     _flightRepository      = flightRepository;
     _ticketRepository      = ticketRepository;
     _destinationRepository = destinationRepository;
     _userHelper            = userHelper;
     _mailHelper            = mailHelper;
 }
Beispiel #11
0
 public EditTripHandler(
     IEventPublisher eventPublisher,
     IEntityRepository entityRepository,
     IUserDataProvider userDataProvider,
     IDestinationRepository destinationRepository)
 {
     _eventPublisher        = eventPublisher;
     _entityRepository      = entityRepository;
     _userDataProvider      = userDataProvider;
     _destinationRepository = destinationRepository;
 }
Beispiel #12
0
 public CreateTripHandler(
     IDestinationRepository destinationRepository,
     IEventPublisher eventPublisher,
     IEntityRepository tripRepository,
     IUserDataProvider userDataProvider)
 {
     _destinationRepository = destinationRepository;
     _eventPublisher        = eventPublisher;
     _tripRepository        = tripRepository;
     _userDataProvider      = userDataProvider;
 }
 public AdminApplicationService(IPermissionRepository permissionRepository,
                                IRoleRepository roleRepository,
                                IUserRepository userRepository,
                                ISourceRepository sourceRepository,
                                IDestinationRepository destinationRepository)
 {
     _permissionRepository  = permissionRepository;
     _roleRepository        = roleRepository;
     _userRepository        = userRepository;
     _sourceRepository      = sourceRepository;
     _destinationRepository = destinationRepository;
 }
Beispiel #14
0
 public DestinationService(
     ILogger <IDestinationRepository> logger,
     IDestinationRepository destinationRepository,
     IApiDestinationRequestModelValidator destinationModelValidator,
     IBOLDestinationMapper boldestinationMapper,
     IDALDestinationMapper daldestinationMapper)
     : base(logger,
            destinationRepository,
            destinationModelValidator,
            boldestinationMapper,
            daldestinationMapper)
 {
 }
Beispiel #15
0
 public AbstractDestinationService(
     ILogger logger,
     IDestinationRepository destinationRepository,
     IApiDestinationRequestModelValidator destinationModelValidator,
     IBOLDestinationMapper bolDestinationMapper,
     IDALDestinationMapper dalDestinationMapper)
     : base()
 {
     this.DestinationRepository     = destinationRepository;
     this.DestinationModelValidator = destinationModelValidator;
     this.BolDestinationMapper      = bolDestinationMapper;
     this.DalDestinationMapper      = dalDestinationMapper;
     this.logger = logger;
 }
Beispiel #16
0
        public void InitializeTest()
        {
            pushPassedToSource   = null;
            rootPassedToSource   = null;
            fakeSourceRepository = new SourceControlSync.Domain.Fakes.StubISourceRepository()
            {
                DownloadChangesAsyncPushStringCancellationToken = (push, root, token) =>
                {
                    token.ThrowIfCancellationRequested();
                    pushPassedToSource = push;
                    rootPassedToSource = root;
                    foreach (var commit in push.Commits)
                    {
                        commit.Changes = Enumerable.Empty <ItemChange>();
                    }
                    return(Task.FromResult(0));
                }
            };

            commitsPassedToCalculator   = null;
            changesReturnedByCalculator = null;
            fakeChangesCalculator       = new SourceControlSync.Domain.Fakes.StubIChangesCalculator()
            {
                CalculateItemChangesIEnumerableOfCommit = (commits) =>
                {
                    commitsPassedToCalculator   = commits;
                    changesReturnedByCalculator = commits.SelectMany(commit => commit.Changes).ToList();
                },
                ItemChangesGet = () => { return(changesReturnedByCalculator); }
            };

            changesPassedToDestination = null;
            rootPassedToDestination    = null;
            fakeDestinationRepository  = new SourceControlSync.Domain.Fakes.StubIDestinationRepository()
            {
                PushItemChangesAsyncIEnumerableOfItemChangeString = (changes, root) =>
                {
                    changesPassedToDestination = changes;
                    rootPassedToDestination    = root;
                    return(Task.FromResult(0));
                },
                ExecutedCommandsGet = () => { return(new SourceControlSync.Domain.Fakes.StubIExecutedCommands()); }
            };

            var fakeClock = new SourceControlSync.Domain.Fakes.StubIClock();

            fakeChangesReport = new ChangesReport(fakeClock);
            fakeErrorReport   = new ErrorReport(fakeClock);
        }
Beispiel #17
0
 public PartController(IProjectRepository projectRepository,
                       ICustomerDynamicsRepository customerDynamicsRepository,
                       ICustomerAddressDynamicsRepository customerAddressDynamicsRepository,
                       IFoundryDynamicsRepository foundryDynamicsRepository,
                       IShipmentTermRepository shipmentTermRepository,
                       IMaterialRepository materialRepository,
                       ICoatingTypeRepository coatingTypeRepository,
                       ISpecificationMaterialRepository specificationMaterialRepository,
                       IProjectPartRepository projectPartRepository,
                       IPriceSheetRepository priceSheetRepository,
                       IPartRepository partRepository,
                       IPartDynamicsRepository partDynamicsRepository,
                       IHtsNumberRepository htsNumberRepository,
                       IPartStatusRepository partStatusRepository,
                       IPartTypeRepository partTypeRepository,
                       IPaymentTermRepository paymentTermRepository,
                       ISurchargeRepository surchargeRepository,
                       ISiteDynamicsRepository siteDynamicsRepository,
                       IPatternMaterialRepository patternMaterialRepository,
                       IDestinationRepository destinationRepository,
                       IFoundryOrderRepository foundryOrderRepository,
                       ICustomerOrderRepository customerOrderRepository,
                       IAccountCodeRepository accountCodeRepository)
 {
     _projectRepository                 = projectRepository;
     _customerDynamicsRepository        = customerDynamicsRepository;
     _customerAddressDynamicsRepository = customerAddressDynamicsRepository;
     _foundryDynamicsRepository         = foundryDynamicsRepository;
     _shipmentTermRepository            = shipmentTermRepository;
     _materialRepository                = materialRepository;
     _coatingTypeRepository             = coatingTypeRepository;
     _specificationMaterialRepository   = specificationMaterialRepository;
     _projectPartRepository             = projectPartRepository;
     _priceSheetRepository              = priceSheetRepository;
     _partRepository            = partRepository;
     _htsNumberRepository       = htsNumberRepository;
     _partStatusRepository      = partStatusRepository;
     _partDynamicsRepository    = partDynamicsRepository;
     _partTypeRepository        = partTypeRepository;
     _paymentTermRepository     = paymentTermRepository;
     _surchargeRepository       = surchargeRepository;
     _siteDynamicsRepository    = siteDynamicsRepository;
     _patternMaterialRepository = patternMaterialRepository;
     _destinationRepository     = destinationRepository;
     _foundryOrderRepository    = foundryOrderRepository;
     _customerOrderRepository   = customerOrderRepository;
     _accountCodeRepository     = accountCodeRepository;
 }
Beispiel #18
0
        public FlightsController(IUserHelper userHelper, IFlightRepository flightRepository, ITicketRepository ticketRepository, IAirplaneRepository airplaneRepository,
                                 IDestinationRepository destinationRepository, DataContext context, IMailHelper mailHelper, IConfiguration configuration)
        {
            _userHelper            = userHelper;
            _flightRepository      = flightRepository;
            _ticketRepository      = ticketRepository;
            _airplaneRepository    = airplaneRepository;
            _destinationRepository = destinationRepository;
            _context       = context;
            _mailHelper    = mailHelper;
            _configuration = configuration;


            //Actualizar o estado dos voos
            flightRepository.UpdateFlightStatus(DateTime.Now);
        }
Beispiel #19
0
 public Option <Domain.TripOffer, string> ToDomain(IDestinationRepository destRepo)
 {
     return
         (destRepo.FindByName(StartLocation)
          .FirstOrNone()
          .WithException($"Start location '{StartLocation}' could not matched!")
          .FlatMap(start =>
                   destRepo.FindByName(EndLocation)
                   .FirstOrNone()
                   .WithException($"End location '{EndLocation}' could not matched!")
                   .Map(end => new Domain.TripOffer(StarTime, start,
                                                    EndTime - StarTime, end,
                                                    new Domain.User(null, OfferedBy))
                        )
                   ));
 }
        public DestinationService(
            ILogger <IDestinationService> logger,
            MediatR.IMediator mediator,
            IDestinationRepository destinationRepository,
            IApiDestinationServerRequestModelValidator destinationModelValidator,
            IDALDestinationMapper dalDestinationMapper,
            IDALPipelineStepDestinationMapper dalPipelineStepDestinationMapper)
            : base()
        {
            this.DestinationRepository            = destinationRepository;
            this.DestinationModelValidator        = destinationModelValidator;
            this.DalDestinationMapper             = dalDestinationMapper;
            this.DalPipelineStepDestinationMapper = dalPipelineStepDestinationMapper;
            this.logger = logger;

            this.mediator = mediator;
        }
Beispiel #21
0
        public CollectionTransitHandler(ISourceRepositoryFactory sourceRepositoryFactory,
                                        IDestinationRepositoryFactory destinationRepositoryFactory,
                                        ICollectionPreparationHandler preparationHandler,
                                        IDocumentsWriterFactory documentsWriterFactory,
                                        IProgressManager manager,
                                        ILogger logger,
                                        CollectionTransitOptions options)
        {
            _manager = manager;
            _logger  = logger;
            _options = options;

            _destination = destinationRepositoryFactory.Create(_logger);
            _source      = sourceRepositoryFactory.Create(_logger);

            _preparationHandler     = preparationHandler;
            _documentsWriterFactory = documentsWriterFactory;
        }
Beispiel #22
0
        public ATTRequestFormBC(IDbFactory dbFactory, IDbFactory dbDocFactory) : base(dbFactory, dbDocFactory)
        {
            _travelDetailRepository = new TravelDetailRepository(dbFactory);
            _attachmentRepository   = new Attachment.TravelDetailRepository(dbDocFactory);
            _destinationRepository  = new DestinationRepository(dbFactory);
            _flightDetailRepository = new FlightDetailRepository(dbFactory);

            AddActivities(new ATTSubmissionActivity());
            AddActivities(new HoDApprovalActivity());
            AddActivities(new ATTReworkedActivity());

            AddActivities(new ATTEXCOApprovalActivity());
            AddActivities(new ATTHRReviewActivity());
            AddActivities(new ATTHRApprovalActivity());
            AddActivities(new ATTNAGATravelActivity());

            AddActivities(new ATTEditFormAcitvity(() => {
                return(CreateEmailData());
            }));
        }
Beispiel #23
0
 public void Initalize()
 {
     repo = new InMemoryDestinationRepository(
         Options.Create(new InMemoryDestinationRepository.Settings()
     {
         Destinations = new[] {
             new Destination.Memento()
             {
                 Name = "Waidhofen an der Ybbs",
                 Lat  = 47.960310,
                 Lon  = 14.772283
             },
             new Destination.Memento()
             {
                 Name = "Linz",
                 Lat  = 48.305598,
                 Lon  = 14.286601
             },
         }
     }
                        ));
 }
Beispiel #24
0
 public TripOfferController(ITripOfferRepository repo, IDestinationRepository destRepo)
 {
     this.repo     = repo;
     this.destRepo = destRepo;
 }
 public void SetUp()
 {
     _mockOriginRepository = Mock.Create<IOriginRepository>();
     _mockDestinationRepository = Mock.Create<IDestinationRepository>();
     _mockPackageTypeSelectListBuilder = Mock.Create<IPackageTypeSelectListBuilder>();
 }
Beispiel #26
0
 public DestinationService(IDestinationRepository destRepo, IMapper mapper)
 {
     _destRepo = destRepo;
     _mapper   = mapper;
 }
Beispiel #27
0
 public DestinationsController(IDestinationRepository repo) =>
 (this.repo) = (repo);
        public void InitializeTest()
        {
            pushPassedToSource = null;
            rootPassedToSource = null;
            fakeSourceRepository = new SourceControlSync.Domain.Fakes.StubISourceRepository()
            {
                DownloadChangesAsyncPushStringCancellationToken = (push, root, token) =>
                {
                    token.ThrowIfCancellationRequested();
                    pushPassedToSource = push;
                    rootPassedToSource = root;
                    foreach (var commit in push.Commits)
                    {
                        commit.Changes = Enumerable.Empty<ItemChange>();
                    }
                    return Task.FromResult(0);
                }
            };

            commitsPassedToCalculator = null;
            changesReturnedByCalculator = null;
            fakeChangesCalculator = new SourceControlSync.Domain.Fakes.StubIChangesCalculator()
            {
                CalculateItemChangesIEnumerableOfCommit = (commits) =>
                {
                    commitsPassedToCalculator = commits;
                    changesReturnedByCalculator = commits.SelectMany(commit => commit.Changes).ToList();
                },
                ItemChangesGet = () => { return changesReturnedByCalculator; }
            };

            changesPassedToDestination = null;
            rootPassedToDestination = null;
            fakeDestinationRepository = new SourceControlSync.Domain.Fakes.StubIDestinationRepository()
            {
                PushItemChangesAsyncIEnumerableOfItemChangeString = (changes, root) =>
                {
                    changesPassedToDestination = changes;
                    rootPassedToDestination = root;
                    return Task.FromResult(0);
                },
                ExecutedCommandsGet = () => { return new SourceControlSync.Domain.Fakes.StubIExecutedCommands(); }
            };

            var fakeClock = new SourceControlSync.Domain.Fakes.StubIClock();
            fakeChangesReport = new ChangesReport(fakeClock);
            fakeErrorReport = new ErrorReport(fakeClock);
        }
Beispiel #29
0
 public TripSearchController(ITripSearcher searcher,
                             IDestinationRepository destRepo)
 {
     this.searcher = searcher;
     this.destRepo = destRepo;
 }
Beispiel #30
0
 public DestinationsController(IDestinationRepository repository)
 {
     _repository = repository;
 }
 public DestinationsController(IDestinationRepository destinationRepository, IMapper mapper, IActionDescriptorCollectionProvider actionDescriptorCollectionProvider) : base(actionDescriptorCollectionProvider)
 {
     _destinationRepository = destinationRepository;
     _mapper = mapper;
 }
Beispiel #32
0
 public void SetUp()
 {
     _mockOriginRepository             = Mock.Create <IOriginRepository>();
     _mockDestinationRepository        = Mock.Create <IDestinationRepository>();
     _mockPackageTypeSelectListBuilder = Mock.Create <IPackageTypeSelectListBuilder>();
 }
Beispiel #33
0
 public DestinationService(IDestinationService destinationService, IDestinationRepository destinationRepository)
 {
     _destinationService    = destinationService;
     _destinationRepository = destinationRepository;
 }