public static void dump(List <BillingInvoice> invoices, int index) { KipleHomeService kipleApi = new KipleHomeService(); try { int batchSize = 10; List <BillingInvoice> currentBatch = Excerpt.extract(invoices, index, index + batchSize); if (currentBatch.Count() != 0) { kipleApi.exportBill(currentBatch); ExportBill.dump(invoices, index + batchSize); } else { Console.WriteLine("Invoice export completed.\n"); } } catch (Exception ex) { Console.WriteLine("==========================================\n"); Console.WriteLine("From Export:\n"); Console.WriteLine(ex.Message); Console.WriteLine("==========================================\n"); } }
private void _sendPayment(List <OutstandingBill> payments, int index) { KipleHomeService kipleHome = new KipleHomeService(); try { int batchSize = 10; List <OutstandingBill> currentBatch = Excerpt.extract(payments, index, index + batchSize); if (currentBatch.Count != 0) { kipleHome.exportPayments(currentBatch); _sendPayment(payments, index + batchSize); } else { Console.WriteLine("Done exporting payments.\n"); } } catch (Exception ex) { Console.WriteLine("==========================================\n"); Console.WriteLine("From Update:\n"); Console.WriteLine(ex.Message); Console.WriteLine("==========================================\n"); } }