public void Setup() { _context = new TestAccountingDataContext(); _categoryName = ""; _newName = ""; _categoryId = -1; }
/// <inheritdoc /> /// <summary> /// Basic ctor that receives 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); }
public DataViewUI() { InitializeComponent(); _dataContext = new AccountingDataContext(); _expenseService = new ExpenseService(new ExpenseRepository(_dataContext)); _incomeService = new IncomeService(new IncomeRepository(_dataContext)); }
/// <inheritdoc /> /// <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) { _dtMonth = dtMonth; InitializeComponent(); _dataContext = new AccountingDataContext(); _expenseService = new ExpenseService(new ExpenseRepository(_dataContext)); _incomeService = new IncomeService(new IncomeRepository(_dataContext)); }
/// <summary> /// Standard Default Ctor /// </summary> public InputOutUI() { InitializeComponent(); _dataContext = new AccountingDataContext(); _expenseService = new ExpenseService(new ExpenseRepository(_dataContext)); _expenseCategoryService = new ExpenseCategoryService(new ExpenseCategoryRepository(_dataContext)); _paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(_dataContext)); }
/// <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); }
/// <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)); }
public void Setup() { _context = new TestAccountingDataContext(); _transaction = null; _transactionService = null; _categoryService = null; _paymentMethodService = null; _category = null; _paymentMethod = null; }
/// <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); }
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(); }
/// <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)); }
/// <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); }
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 } }; }
/// <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)); }
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 } }; }
/// <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 ExpenseRepository(AccountingDataContext context) { _context = context; }
public GeneralCategoryHandler(AccountingDataContext dataContext) { _dataContext = dataContext; }
public IncomeCategoryRepository(AccountingDataContext context) { _context = context; }
public void Setup() { _context = new TestAccountingDataContext(); _categoryService = null; _categoryName = ""; }
public PaymentMethodRepository(AccountingDataContext context) { _context = context; }
public MonthService(AccountingDataContext accountingDataContext) { _expenseService = new ExpenseService(new ExpenseRepository(accountingDataContext)); _incomeService = new IncomeService(new IncomeRepository(accountingDataContext)); }