Пример #1
0
        private static void ReceiptsReceivedHandler(object sender, ReceiptsReceivedEventArgs e)
        {
            if (!e.SuccessfullyFetchedReceipts)
            {
                Print("Failed to load receipts", ConsoleColor.Red);
                return;
            }

            Print("Successfully loaded receipts", ConsoleColor.Green);
            foreach (var receipt in e.Receipts)
            {
                Print(receipt.ToString(), ConsoleColor.Cyan);
            }

            Print("Total amount: " + coopReceiptManager.GetTotalAmount(), ConsoleColor.Cyan);
            Print("Total amount last 7 days: " + coopReceiptManager.GetTotalAmount(7), ConsoleColor.Cyan);
            Print("Total amount last 14 days: " + coopReceiptManager.GetTotalAmount(14), ConsoleColor.Cyan);
            Print("Total amount last 30 days: " + coopReceiptManager.GetTotalAmount(30) + "\n", ConsoleColor.Cyan);
            Print("Loading data for " + e.Receipts.First().Id, ConsoleColor.Green);
            coopReceiptManager.GetReceiptDetails(e.Receipts.First().Id);
        }