示例#1
0
        /// <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));
        }
示例#2
0
        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 }
            };
        }
示例#3
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));
        }
示例#4
0
        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}
            };
        }
示例#5
0
        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 }
            };
        }
示例#6
0
        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}
            };
        }