public static List <Income> GetAllIncomes(FinancialSummary financialSummary, ExpenseTrackerContext _context) { var currentMonthFinancialObj = _context.Incomes.Where(b => b.Date.Month == financialSummary.Date.Month && b.Date.Year == financialSummary.Date.Year && b.ProfileNo == financialSummary.ProfileNo); return(currentMonthFinancialObj.ToList()); //throw new NotImplementedException(); }
public FinancialController(ExpenseTrackerContext context) { try { financialSummaryBL = new FinancialSummaryBL(context); } catch (Exception e) { Console.WriteLine("Exception in getting Context object", e); } }
public UserController(ExpenseTrackerContext context) { _context = context; if (_context.Users.Count() == 0) { _context.Users.AddRange(new User { UserName = "******", Password = "******" }); //Set UserName and password startup _context.SaveChanges(); } }
public ExpenseController(ExpenseTrackerContext context) { try { expenseBL = new ExpenseBL(context); } catch (Exception e) { Console.WriteLine("Exception in getting Context object", e); } }
public IncomeSourceController(ExpenseTrackerContext context) { try { incomeSourceBL = new IncomeSourceBL(context); incomeSourceBL.AddIncomeSources(); } catch (Exception e) { Console.WriteLine("Exception in getting Context object", e); } }
public CategoryController(ExpenseTrackerContext context) { try { catBL = new CategoryBL(context); catBL.AddCategories(); } catch (Exception e) { Console.WriteLine("Exception in getting Context object", e); } }
public CurrencyController(ExpenseTrackerContext context) { try { currencyBL = new CurrencyBL(context); currencyBL.AddCurrency(); } catch (Exception e) { Console.WriteLine("Exception in getting Context object", e); } }
public PaymentController(ExpenseTrackerContext context) { try { paymentBL = new PaymentBL(context); paymentBL.AddPayments(); } catch (Exception e) { Console.WriteLine("Exception in getting Context object", e); } }
public ExpenseTrackerEFRepository(ExpenseTrackerContext ctx) { _ctx = ctx; // Disable lazy loading - if not, related properties are auto-loaded when // they are accessed for the first time, which means they'll be included when // we serialize (b/c the serialization process accesses those properties). // // We don't want that, so we turn it off. We want to eagerly load them (using Include) // manually. _ctx.Configuration.LazyLoadingEnabled = false; }
public FinancialSummaryBL(ExpenseTrackerContext context) { _context = context; }
public IncomeSourceBL(ExpenseTrackerContext context) { _context = context; }
public CostDao(ExpenseTrackerContext context) { _context = context; }
public BaseRepository(ExpenseTrackerContext context) { _context = context; }
public PaymentOperations() { context = new ExpenseTrackerContext(); }
public CurrencyBL(ExpenseTrackerContext context) { _context = context; }
public NameDao(ExpenseTrackerContext context) { _context = context; }
public PaymentBL(ExpenseTrackerContext context) { _context = context; }
public ExpenseBL(ExpenseTrackerContext context) { _context = context; }
public static FinancialSummary GetfinancialSummary(FinancialSummary financialSummary, ExpenseTrackerContext _context) { FinancialSummary financialSummaryObj = null; decimal currentMonthexpense = 0; try { //find current month total incomes and total budget var currentMonthFinancialObj = _context.Incomes.Where(b => b.Date.Month == financialSummary.Date.Month && b.Date.Year == financialSummary.Date.Year && b.ProfileNo == financialSummary.ProfileNo); decimal currentMonthIncome = currentMonthFinancialObj.Sum(d => d.Amount); decimal currentMonthBudget = currentMonthFinancialObj.Sum(d => d.Budget); var currentMonthExpenseObj = _context.Expenses.Where(b => b.ExpenseDate.Month == financialSummary.Date.Month && b.ExpenseDate.Year == financialSummary.Date.Year && b.ProfileNo == financialSummary.ProfileNo); currentMonthexpense = currentMonthExpenseObj.Sum(d => d.Amount); // var incomesObj = _context.Incomes.Where(b => b.Date.Month <= financialSummary.Date.Month && b.Date.Year <= financialSummary.Date.Year && b.ProfileNo == financialSummary.ProfileNo); var expenseObj = _context.Expenses.Where(b => b.ExpenseDate.Month < financialSummary.Date.Month && b.ExpenseDate.Year <= financialSummary.Date.Year && b.ProfileNo == financialSummary.ProfileNo); decimal totalIncome = 0; decimal totalExpense = 0; decimal totalSavings = 0; if (incomesObj != null) { totalIncome = incomesObj.Sum(d => d.Amount); } if (expenseObj != null) { totalExpense = expenseObj.Sum(d => d.Amount); } totalSavings = (totalIncome - totalExpense) - currentMonthBudget; financialSummaryObj = new FinancialSummary(); financialSummaryObj.Income = currentMonthIncome; if (currentMonthexpense >= currentMonthBudget) { financialSummaryObj.Budget = 0; financialSummaryObj.Savings = totalSavings - (currentMonthexpense - currentMonthBudget); } else { financialSummaryObj.Budget = currentMonthBudget - currentMonthexpense; financialSummaryObj.Savings = totalSavings; } //Financial Health GetFinancialHealth(financialSummaryObj, currentMonthexpense, currentMonthBudget); } catch (Exception e) { Console.WriteLine("Exception in getting financial summary", e); } return(financialSummaryObj); }
public CategoryBL(ExpenseTrackerContext context) { _context = context; }
public ExpenseAnalyzer() { _context = new ExpenseTrackerContext(); }
public DescriptionDao(ExpenseTrackerContext context) { _context = context; }
public ExpenseController(ILogger <ExpenseController> logger, ExpenseTrackerContext ctx) { this.logger = logger; this.ctx = ctx; }
public ExpenseItemsController(ExpenseTrackerContext context, ILogger <ExpenseItemsController> logger) { _context = context; _logger = logger; }
public ExpenseService(ExpenseTrackerContext context, ILogger <ExpenseService> logger) { _context = context; _logger = logger; }
public ExpenseMasterOperations() { context = new ExpenseTrackerContext(); }
public StatsDataCollector() { _context = new ExpenseTrackerContext(); }