Beispiel #1
0
        public async Task <ActionResult <IEnumerable <Billing> > > SearchBillingData(MatchingBillingSearch option, CancellationToken token)
        {
            List <Billing> result = null;

            option.Orders = (await collationSettingProcessor
                             .GetMatchingBillingOrderAsync(option.CompanyId, token))
                            .Where(x => (x.Available == 1)).ToArray();


            if (!option.MatchingHeaderId.HasValue)
            {
                result = (await matchingProcessor.SearchBillingDataAsync(option, token)).ToList();
            }
            else
            {
                result = (await matchingProcessor.GetMatchedBillingsAsync(option, token)).ToList();
            }
            return(result);
        }
Beispiel #2
0
        public async Task<BillingsResult> SearchBillingDataAsync(string SessionKey, MatchingBillingSearch MatchingBillingSearch)
        {
            return await authorizationProcessor.DoAuthorizeAsync(SessionKey, async token =>
            {
                List<Billing> result = null;
                MatchingBillingSearch.Orders = (await collationSettingProcessor
                    .GetMatchingBillingOrderAsync(MatchingBillingSearch.CompanyId, token))
                    .Where(x => (x.Available == 1)).ToArray();

                if (!MatchingBillingSearch.MatchingHeaderId.HasValue)
                {
                    result = (await matchingProcessor.SearchBillingDataAsync(MatchingBillingSearch, token)).ToList();
                }
                else
                {
                    result = (await matchingProcessor.GetMatchedBillingsAsync(MatchingBillingSearch, token)).ToList();
                }
                return new BillingsResult
                {
                    ProcessResult = new ProcessResult { Result = true },
                    Billings = result,
                };
            }, logger);
        }