Example #1
0
        /// <summary>
        ///     Standard Default Ctor
        /// </summary>
        public InputINUI()
        {
            InitializeComponent();

            _dataContext = new AccountingDataContext();
            _incomeCategoryService = new IncomeCategoryService(new IncomeCategoryRepository(_dataContext));
            _paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(_dataContext));
            _incomeService = new IncomeService(new IncomeRepository(_dataContext));
        }
Example #2
0
        /// <summary>
        ///     Sets the intial state and current state expense properties of the form
        /// </summary>
        /// <param name="income">The income the form was opened for</param>
        public IncomeViewer(Income income)
        {
            InitializeComponent();

            currentIncome = income;
            originalIncome = currentIncome.Copy();

            _dataContext = new AccountingDataContext();
            _incomeService = new IncomeService(new IncomeRepository(_dataContext));
            _incomeCategoryService = new IncomeCategoryService(new IncomeCategoryRepository(_dataContext));
            _paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(_dataContext));
        }
Example #3
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 }
            };
        }
Example #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}
            };
        }
Example #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 }
            };
        }
Example #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}
            };
        }