コード例 #1
0
        /// <summary>
        /// Books new cargo for specified origin, destination and arrival deadline.
        /// </summary>
        /// <param name="origin">Origin of a cargo in UnLocode format.</param>
        /// <param name="destination">Destination of a cargo in UnLocode format.</param>
        /// <param name="arrivalDeadline">Arrival deadline.</param>
        /// <returns>Cargo tracking id.</returns>
        public string BookNewCargo(string origin, string destination, DateTime arrivalDeadline)
        {
            var command = new BookNewCargoCommand
            {
                Origin          = origin,
                Destination     = destination,
                ArrivalDeadline = arrivalDeadline
            };
            var result = (BookNewCargoCommandResult)_pipelineFactory.Process(command);

            return(result.TrackingId);
        }
コード例 #2
0
        public void RegisterHandlingEvent(DateTime completionTime, string trackingId, string location, HandlingEventType type)
        {
            var command = new RegisterHandlingEventCommand
            {
                CompletionTime    = completionTime,
                TrackingId        = trackingId,
                OccuranceLocation = location,
                Type = type
            };

            _pipelineFactory.Process(command);
        }
コード例 #3
0
        public PagedList <GameDTO> GetAll(PaginationParameters paginationParameters, FilterParameters filterParameters)
        {
            if (paginationParameters == null || filterParameters == null)
            {
                throw new ArgumentNullException();
            }

            var games         = Database.Games.GetAll();
            var pipeline      = new PipelineFactory().Create(filterParameters);
            var filteredGames = pipeline.Process(games);

            return(PagedList <GameDTO> .Create(filteredGames.ProjectTo <GameDTO>(), paginationParameters.PageNumber, paginationParameters.PageSize));
        }