public ExpenseReport ExpenseReport(string name, string type) { ExpenseReport expenseReport; using (var db = new FinancialContext()) { //refacter to service var expense = (from b in db.Expenses where b.ExpenseType == type select b).FirstOrDefault(); var person = (from b in db.Persons where b.Name == name select b).FirstOrDefault(); //build expense report object expenseReport = new ExpenseReport { Name = person.Name, Department = person.Department, ExpenceAmount = expense.ExpenseAmount, ExpenseType = expense.ExpenseType }; } return(expenseReport); }
public int CreateNewExpense(Expense e) { using (var db = new FinancialContext()) { int result = 0; string type = "placeholder", amount = "placeholder"; type = e.ExpenseType; amount = e.ExpenseAmount; var expense = new Expense { ExpenseType = type, ExpenseAmount = amount }; db.Expenses.Add(expense); result = db.SaveChanges(); if (false) { //handle unexpected result } else { return(result); } } }
public FinancialController(FinancialContext ctx, IFMUnitOfWork uow, IFMUser user, IAccountant accountant, IMasterAccountant masterAccountant) { this._Context = ctx; this._UserRole = user; this._Uow = uow; this._AccountantRole = accountant; this._MasterAccountantRole = masterAccountant; }
public Person Person(string name) { Person person; using (var db = new FinancialContext()) { //refacter to service person = (from b in db.Persons where b.Name == name select b).FirstOrDefault(); } return(person); }
public IList <Person> People(string name, string department) { List <Person> peopleReport; using (var db = new FinancialContext()) { //refacter to service peopleReport = (from b in db.Persons where b.Name == name orderby b.Department, b.Name select b).ToList(); } return(peopleReport); }
public IList <Expense> Expenses() { var result = new List <Expense>(); using (var db = new FinancialContext()) { //refacter to service var query = (from b in db.Expenses orderby b.ExpenseType select b).ToList(); result = query; } return(result); }
public DashboardRepository(FinancialContext context) { this.context = context; }
public TransactionsController(FinancialContext context, UserManager <ApplicationUser> userManager) { this.context = context; this.userManager = userManager; }
public EmployeesRepository(FinancialContext context) { this.context = context; }
public ReportsController(FinancialContext context) { this.context = context; }
public GroupController(FinancialContext finContext) { _finContext = finContext; }
//private readonly Dictionary<string, string> _monthNumber = new Dictionary<string, string>() //{ // { "Jan", "01" }, // { "Feb", "02" }, // { "Mar", "03" }, // { "Apr", "04" }, // { "May", "05" }, // { "Jun", "06" }, // { "Jul", "07" }, // { "Aug", "08" }, // { "Sep", "09" }, // { "Oct", "10" }, // { "Nov", "11" }, // { "Dec", "12" }, //}; public CalendarController(FinancialContext context) { _context = context; }
public UserController(FinancialContext finContext) { _finContext = finContext; }
public AccountantController(FinancialContext ctx, IFMUnitOfWork uow, IAccountant patrick) { this._Context = ctx; this._Service = patrick; this._Uow = uow; }
public PassedEventsNotificationViewComponent(FinancialContext context) { this.context = context; }
public PredictionRepository(FinancialContext financialContext) { this.financialContext = financialContext ?? throw new ArgumentNullException($"{nameof(financialContext)} in PredictionRepository"); }
public RemindingsNotificationViewComponent(FinancialContext context) { this.context = context; }
public HomeController(FinancialContext context) { _context = context; }
public CodesRepository(FinancialContext context) { this.context = context; }
public OperationController(FinancialContext financialContext) { _finContext = financialContext; }
public UserController(FinancialContext ctx, IFMUnitOfWork uow, IFMUser patrick) { this._Context = ctx; this._Service = patrick; this._Uow = uow; }
public static void InitializeDbForTests(FinancialContext db) { db.Customers.AddRange(GetSeedingCustomers()); db.SaveChanges(); }
public AccountsRepository(FinancialContext context) { this.context = context; }
public static void ReinitializeDbForTests(FinancialContext db) { db.Customers.RemoveRange(db.Customers); InitializeDbForTests(db); }