Пример #1
0
        public DataViewUI()
        {
            InitializeComponent();

            _dataContext = new AccountingDataContext();
            _expenseService = new ExpenseService(new ExpenseRepository(_dataContext));
            _incomeService = new IncomeService(new IncomeRepository(_dataContext));
        }
Пример #2
0
        /// <summary>
        /// Basic ctor that recieves an indicator of which category group
        ///  the category is being added to
        /// </summary>
        /// <param name="categoryType">Category group indicator</param>
        public AddCategoryUI(CategoryType categoryType)
        {
            InitializeComponent();
            CategoryType = categoryType;

            _context = new AccountingDataContext();
            _categoryService = new CategoryService(_context);
        }
Пример #3
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));
        }
Пример #4
0
        /// <summary>
        ///     Default Ctor - intializes the properies of the form
        /// </summary>
        public DataChartUI()
        {
            // Auto generated code for the form
            InitializeComponent();

            _dataContext = new AccountingDataContext();
            _generalCategoryHandler = new GeneralCategoryHandler(_dataContext);
            _monthService = new MonthService(_dataContext);
        }
Пример #5
0
        /// <summary>
        ///     Ctor that also sets the data member of the month being viewed
        ///     with the value given
        /// </summary>
        /// <param name="dtMonth">The month to view data for</param>
        public MonthChartUI(DateTime dtMonth)
        {
            m_dtMonth = dtMonth;
            InitializeComponent();

            _dataContext = new AccountingDataContext();
            _expenseService = new ExpenseService(new ExpenseRepository(_dataContext));
            _incomeService = new IncomeService(new IncomeRepository(_dataContext));
        }
Пример #6
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));
        }
Пример #7
0
        public MultipleCategoriesCompare()
        {
            InitializeComponent();

            MonthData = new Dictionary<string, Dictionary<DateTime, decimal>>();
            _dataContext = new AccountingDataContext();
            var generalCategoryHandler = new GeneralCategoryHandler(_dataContext);
            _monthService = new MonthService(_dataContext);
            CategoryNames = generalCategoryHandler.GetAllCategoryNames().ToList();
        }
Пример #8
0
 public void Setup()
 {
     context = new TestAccountingDataContext();
     _transaction = null;
     _transactionService = null;
     _categoryService = null;
     _paymentMethodService = null;
     _category = null;
     _paymentMethod = null;
 }
Пример #9
0
        /// <summary>
        /// C'tor that intializes the category group property
        /// </summary>
        /// <param name="nCategoryId">The category group id</param>
        public ViewCategoriesUI(int nCategoryId)
        {
            // Sets the property with the id given
            this.CategoryType = nCategoryId;

            // Auto generated code for the form
            InitializeComponent();

            _context = new AccountingDataContext();
            _categoryService = new CategoryService(_context);
        }
Пример #10
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));
        }
Пример #11
0
        /// <summary>
        ///     Default Ctor - intializes the properies of the form
        /// </summary>
        public DataChartUI()
        {
            // Intializes the local properties of the form
            CategoryNames = new List<string>();
            MonthData = new Dictionary<string, Dictionary<DateTime, decimal>>();

            // Auto generated code for the form
            InitializeComponent();

            _dataContext = new AccountingDataContext();
            _generalCategoryHandler = new GeneralCategoryHandler(_dataContext);
            _monthService = new MonthService(_dataContext);
        }
Пример #12
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));
        }
Пример #13
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}
            };
        }
Пример #14
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}
            };
        }
Пример #15
0
        /// <summary>
        ///     Loads the data for the requested month and connects it to the form
        /// </summary>
        private void LoadMe()
        {
            // Updates the lable to display the name of the month being viewed
            lblMonth.Text = m_dtMonth.GetDateTimeFormats('Y')[0];

            using (var context = new AccountingDataContext())
            {
                var expenseService = new ExpenseService(new ExpenseRepository(context));
                var incomeService = new ExpenseService(new ExpenseRepository(context));
                var expenseData = expenseService.GetAllPaymentMethodTotals(m_dtMonth);
                var incomeData = incomeService.GetAllPaymentMethodTotals(m_dtMonth);

                crtExpenses.Series[0].Points.DataBind(expenseData, "KEY", "VALUE", "");
                UpdatePoints(crtExpenses.Series[0].Points);

                crtIncome.Series[0].Points.DataBind(incomeData, "KEY", "VALUE", "");
                UpdatePoints(crtIncome.Series[0].Points);
            }
        }
Пример #16
0
 public MonthService(AccountingDataContext accountingDataContext)
 {
     _expenseService = new ExpenseService(new ExpenseRepository(accountingDataContext));
     _incomeService = new IncomeService(new IncomeRepository(accountingDataContext));
 }
Пример #17
0
 public PaymentMethodRepository(AccountingDataContext context)
 {
     _context = context;
 }
Пример #18
0
 public GeneralCategoryHandler(AccountingDataContext dataContext)
 {
     _dataContext = dataContext;
 }
Пример #19
0
 public void Setup()
 {
     context = new TestAccountingDataContext();
     _categoryName = "";
     _newName = "";
     _categoryId = -1;
 }
Пример #20
0
 public IncomeCategoryRepository(AccountingDataContext context)
 {
     _context = context;
 }
Пример #21
0
 public ExpenseRepository(AccountingDataContext context)
 {
     _context = context;
 }