예제 #1
0
        private static void GetPaymentList(ref bool success)
        {
            if (_startDate != null)
            {
                if (_endDate == null)
                {
                    Console.WriteLine("You must also specify an end date.");
                    Console.WriteLine("Try 'jgdata --help' for more information.");
                    return;
                }
            }

            if (_endDate != null)
            {
                if (_startDate == null)
                {
                    Console.WriteLine("You must also specify a start date.");
                    Console.WriteLine("Try 'jgdata --help' for more information.");
                    return;
                }
            }

            if (_startDate == null && _endDate == null)
            {
                Console.WriteLine("No payment id or date range specified.");
                Console.WriteLine("Try 'jgdata --help' for more information.");
                return;
            }

            PaymentReport.RetrievePaymentList(_startDate.Value, _endDate.Value, _excelFile);
            success = true;
        }
예제 #2
0
        private static void GetDonationPayment(ref bool success)
        {
            if (_paymentId != null)
            {
                if (_startDate != null || _endDate != null)
                {
                    Console.WriteLine("You cannot specify date ranges when retrieving a single payment.");
                    Console.WriteLine("Try 'jgdata --help' for more information.");
                    return;
                }

                try
                {
                    PaymentReport.RetrieveSingleDonationPayment(_paymentId.Value, _excelFile);
                    success = true;
                }
                catch (ResourceNotFoundException)
                {
                    Console.WriteLine("404 Not found");
                }
            }
        }