コード例 #1
0
        public static void FinancialReport()
        {
            List <Item>        Items        = StockManager.getAllItems();
            List <Transaction> Transactions = StockManager.getAllTransactions();
            decimal            globaltotal  = 0;

            Console.WriteLine("\nFinancial Report");
            Console.WriteLine("\t{0, -3} {1, -10} {2, -5}",
                              "ID",
                              "Name",
                              "Expenditure");

            foreach (Item item in Items)
            {
                int     id    = item.getID();
                decimal total = 0;

                foreach (Transaction transaction in Transactions)
                {
                    if (transaction.getItem().getID() == id)
                    {
                        total += transaction.getPrice();
                    }
                }

                DisplayItemFinance(id.ToString(), item.getItemName(), total.ToString());
                globaltotal += total;
            }

            Console.WriteLine("\n\tTotal Expenditure is: " + globaltotal.ToString());
        }
コード例 #2
0
        public static void DisplayTransactionLog()
        {
            List <Transaction> Transactions = StockManager.getAllTransactions();

            Console.WriteLine("\nTransaction Log");
            Console.WriteLine("\t{0, -19} {1, -6} {2, -3} {3, -10} {4, -10} {5, -5}",
                              "Date",
                              "Type",
                              "ID",
                              "Name",
                              "Employee",
                              "Price");

            foreach (Transaction transaction in Transactions)
            {
                DisplayTransaction(transaction);
            }
        }
コード例 #3
0
        public static void ReportPersonalUsage(string employee)
        {
            List <Transaction> Transactions = StockManager.getAllTransactions();

            Console.WriteLine("\nTransaction Log");
            Console.WriteLine("\t{0, -19} {1, -6} {2, -3} {3, -10} {4, -10} {5, -5}",
                              "Date",
                              "Type",
                              "ID",
                              "Name",
                              "Employee",
                              "Price");

            foreach (Transaction transaction in Transactions)
            {
                if (transaction.getEmployee() == employee)
                {
                    DisplayTransaction(transaction);
                }
            }
        }