Beispiel #1
0
        public Expense EditExpense(Guid id, string name, Expense.ExpenseCategory category, DateTime date, TransactionValue value)
        {
            var foundExpense = this._expenses.FirstOrDefault(e => e.Id == id);

            if (foundExpense == null)
            {
                throw new Error.ExpenseNotFound();
            }

            foundExpense.Update(this.Id, name, category, date, value);

            return(foundExpense);
        }
Beispiel #2
0
 public void AddExpense(String name, Expense.ExpenseCategory category,
                        int mileage, double cost, String description)
 {
     expenses.Add(new Expense(name, category, mileage, cost, description));
 }