/// <summary> /// Standard Default Ctor /// </summary> public RecurringExpenseInput() { InitializeComponent(); _dataContext = new AccountingDataContext(); _expenseService = new ExpenseService(new ExpenseRepository(_dataContext)); _expenseCategoryService = new ExpenseCategoryService(new ExpenseCategoryRepository(_dataContext)); _paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(_dataContext)); }
public CategoryService(AccountingDataContext context) { var expenseCategoryService = new ExpenseCategoryService(new ExpenseCategoryRepository(context)); var incomeCategoryService = new IncomeCategoryService(new IncomeCategoryRepository(context)); var paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(context)); CategoryHandlers = new Dictionary <CategoryType, ICategoryService <Category> > { { CategoryType.Expense, expenseCategoryService }, { CategoryType.Income, incomeCategoryService }, { CategoryType.PaymentMethod, paymentMethodService } }; }
/// <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)); }
public CategoryService(AccountingDataContext context) { var expenseCategoryService = new ExpenseCategoryService(new ExpenseCategoryRepository(context)); var incomeCategoryService = new IncomeCategoryService(new IncomeCategoryRepository(context)); var paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(context)); CategoryHandlers = new Dictionary<CategoryType, ICategoryService<Category>> { {CategoryType.Expense, expenseCategoryService}, {CategoryType.Income, incomeCategoryService}, {CategoryType.PaymentMethod, paymentMethodService} }; }
public CategoryService(AccountingDataContext context) { var context1 = context; var expenseCategoryService = new ExpenseCategoryService(new ExpenseCategoryRepository(context1)); var incomeCategoryService = new IncomeCategoryService(new IncomeCategoryRepository(context1)); var paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(context1)); _categoryServicesById = new Dictionary <int, ICategoryService> { { 1, expenseCategoryService }, { 2, incomeCategoryService }, { 3, paymentMethodService } }; }
public CategoryService(AccountingDataContext context) { var context1 = context; var expenseCategoryService = new ExpenseCategoryService(new ExpenseCategoryRepository(context1)); var incomeCategoryService = new IncomeCategoryService(new IncomeCategoryRepository(context1)); var paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(context1)); _categoryServicesById = new Dictionary<int, ICategoryService> { {1, expenseCategoryService}, {2, incomeCategoryService}, {3, paymentMethodService} }; }