コード例 #1
0
ファイル: DataViewUI.cs プロジェクト: qchouleur/MyHome
        public DataViewUI()
        {
            InitializeComponent();

            _dataContext = new AccountingDataContext();
            _expenseService = new ExpenseService(new ExpenseRepository(_dataContext));
            _incomeService = new IncomeService(new IncomeRepository(_dataContext));
        }
コード例 #2
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));
        }
コード例 #3
0
ファイル: MonthChartUI.cs プロジェクト: qchouleur/MyHome
        /// <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));
        }
コード例 #4
0
ファイル: ExpenseViewer.cs プロジェクト: stoiandan/MyHome
        /// <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));
        }
コード例 #5
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);
            }
        }
コード例 #6
0
 public MonthService(AccountingDataContext accountingDataContext)
 {
     _expenseService = new ExpenseService(new ExpenseRepository(accountingDataContext));
     _incomeService  = new IncomeService(new IncomeRepository(accountingDataContext));
 }
コード例 #7
0
ファイル: MonthService.cs プロジェクト: qchouleur/MyHome
 public MonthService(AccountingDataContext accountingDataContext)
 {
     _expenseService = new ExpenseService(new ExpenseRepository(accountingDataContext));
     _incomeService = new IncomeService(new IncomeRepository(accountingDataContext));
 }