Esempio n. 1
0
            /// <summary>
            /// Executes the workflow to retrieve StockCount journal / transactions RetailServer database.
            /// </summary>
            /// <param name="request">The request.</param>
            /// <returns>The response.</returns>
            protected override GetStockCountResponse Process(GetStockCountRequest request)
            {
                ThrowIf.Null(request, "request");

                Request serviceRequest;
                GetStockCountResponse response;

                if (!request.IncludeOnlyTransactions)
                {
                    serviceRequest = new GetStockCountJournalServiceRequest()
                    {
                        JournalId           = request.JournalId,
                        QueryResultSettings = request.QueryResultSettings
                    };

                    var serviceResponse = this.Context.Execute <GetStockCountJournalServiceResponse>(serviceRequest);
                    response = new GetStockCountResponse(serviceResponse.StockCountJournals);
                }
                else
                {
                    serviceRequest = new GetStockCountJournalTransactionServiceRequest()
                    {
                        JournalId = request.JournalId
                    };

                    var serviceResponse = this.Context.Execute <GetStockCountJournalTransactionServiceResponse>(serviceRequest);
                    response = new GetStockCountResponse(serviceResponse.StockCountJournalTransactions);
                }

                return(response);
            }
 /// <summary>
 /// Invokes the method in StockCount that executes GetStockCountJournalTransactions.
 /// </summary>
 /// <param name="request">GetStockCountJournalTransactionServiceRequest request.</param>
 /// <returns>Returns GetStockCountJournalTransactionServiceResponse.</returns>
 private static GetStockCountJournalTransactionServiceResponse GetStockCountJournalTransactions(GetStockCountJournalTransactionServiceRequest request)
 {
     return(StockCountServiceHelper.GetStockCountJournalTransactions(request.RequestContext, request.JournalId));
 }