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()); }
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); } }
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); } } }