public DataViewUI() { InitializeComponent(); _dataContext = new AccountingDataContext(); _expenseService = new ExpenseService(new ExpenseRepository(_dataContext)); _incomeService = new IncomeService(new IncomeRepository(_dataContext)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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); } }
public MonthService(AccountingDataContext accountingDataContext) { _expenseService = new ExpenseService(new ExpenseRepository(accountingDataContext)); _incomeService = new IncomeService(new IncomeRepository(accountingDataContext)); }