Ejemplo n.º 1
0
        /// <summary>
        ///     Sets the intial state and current state expense properties of the form
        /// </summary>
        /// <param name="expense">The expense the form was opened for</param>
        public ExpenseViewer(Expense expense)
        {
            currentExpense = expense;

            // Makes a shallow copy of the expense passed in
            originalExpense = currentExpense.Copy();
            InitializeComponent();

            _dataContext = new AccountingDataContext();
            _expenseService = new ExpenseService(new ExpenseRepository(_dataContext));
            _expenseCategoryService = new ExpenseCategoryService(new ExpenseCategoryRepository(_dataContext));
            _paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(_dataContext));
        }