Beispiel #1
0
        //Get Invoice
        public async Task <dynamic> GetInvoiceDetails(InvoiceDetailModel model)
        {
            SecurityToken token = await GetSecurityToken();

            var client = new PaymentGateway.IeBizServiceClient();
            var data   = await client.GetInvoiceAsync(token, model.customerId, model.subCustomerId, model.invoiceNo, model.invoiceInternalId);

            return(data);
        }
Beispiel #2
0
        //Search Invoices with Pagination
        public async Task <dynamic> SearchInvoicesWithPagination(InvoiceDetailModel model)
        {
            SecurityToken token = await GetSecurityToken();

            var client = new PaymentGateway.IeBizServiceClient();

            model.start = (model.pageno - 1) * model.pagesize;
            model.limit = model.pagesize;
            var data = await client.SearchInvoicesAsync(token, model.customerId, model.subCustomerId, model.invoiceNo, model.invoiceInternalId, model.searchFilters, model.start, model.limit, model.sort, model.includeItems);

            return(data);
        }
Beispiel #3
0
        //Search Invoices
        public async Task <dynamic> SearchAllInvoices(InvoiceDetailModel model)
        {
            SecurityToken token = await GetSecurityToken();

            var client = new PaymentGateway.IeBizServiceClient();
            List <InvoiceReturnModel> invoicesReturnModels = new List <InvoiceReturnModel>();
            int length     = 0;
            int lengthnode = 0;

            do
            {
                lengthnode++;
                var data = await client.SearchInvoicesAsync(token, model.customerId, model.subCustomerId, model.invoiceNo, model.invoiceInternalId, model.searchFilters, model.start, model.limit, model.sort, model.includeItems);

                length = data.Length;
                InvoiceReturnModel invoiceReturn = new InvoiceReturnModel();
                invoiceReturn.invoices = data.ToList();
                invoicesReturnModels.Add(invoiceReturn);
                model.start = Int32.Parse(lengthnode + "000");
                model.limit = Int32.Parse(lengthnode + "999");
            } while (length >= 1000);
            return(invoicesReturnModels);
        }