Exemplo n.º 1
0
        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");
            }
        }
Exemplo n.º 2
0
        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");
            }
        }
Exemplo n.º 3
0
        private void _exportReceipts(List <Officialreceipts> officialreceipts)
        {
            KipleHomeService kipleApi = new KipleHomeService();

            Console.WriteLine("Exporting receipts to kiple home...\n");
            kipleApi.exportReceipts(officialreceipts);
        }
Exemplo n.º 4
0
        private void _checkBills()
        {
            GetOutstanding getOutstanding = new GetOutstanding();

            getOutstanding.uuid   = _uuid;
            getOutstanding.status = _status;
            getOutstanding.start  = _start.ToString("yyyy-MM-dd");
            getOutstanding.end    = _end.ToString("yyyy-MM-dd");
            KipleHomeService kipleHomeService = new KipleHomeService();
            IRestResponse    restResponse     = kipleHomeService.inquirePending(getOutstanding);

            _constructList(restResponse);
        }
Exemplo n.º 5
0
        private void _checkPayments()
        {
            GetPayments getPayments = new GetPayments();

            getPayments.uuid  = _uuid;
            getPayments.start = _start.ToString("yyyy-MM-dd");
            getPayments.end   = _end.ToString("yyyy-MM-dd");

            Console.WriteLine($"Checking pamyents made between {getPayments.start} and {getPayments.end} \n");

            KipleHomeService kipleHomeService = new KipleHomeService();
            IRestResponse    restResponse     = kipleHomeService.checkPayments(getPayments);

            _constructList(restResponse);
        }