public IActionResult Index() { ViewData["db"] = "Payrolls"; List <string> tablesName = new List <string>(); AccountantViewModel vm = new AccountantViewModel(); if (User.IsInRole("admin")) { vm.Payrolls = db.Payrolls.ToList(); vm.FinanceReports = db.FinanceReports.ToList(); //foreach (var entityType in db.Model.GetEntityTypes()) //{ // var tableName = entityType.Relational().TableName; // tablesName.Add(tableName); // foreach (var propertyType in entityType.GetProperties()) // { // var columnName = propertyType.Relational().ColumnName; // } //} } return(View(vm)); }
public ActionResult Index() { AccountantViewModel vm = new AccountantViewModel(); vm.Tables = db.Tables.Where(t => t.Position.Name == "Accountant").ToList(); ViewData["db"] = "Default"; return(View(vm)); }
/// <summary> /// Return the accountant index page /// GET: ~/Accountant/Accountant/Index /// </summary> /// <returns></returns> public ActionResult Index() { var user = Accountant.getDetail(); var model = new AccountantViewModel() { Name = user.Name, }; return(View(model)); }
public ActionResult Index(string table) { AccountantViewModel vm = new AccountantViewModel(); ViewData["db"] = table; vm.Payrolls = db.Payrolls.Include(p => p.Employee).ToList(); vm.FinanceReports = db.FinanceReports.Include(f => f.Employee).ToList(); vm.Tables = db.Tables.Where(t => t.Position.Name == "Accountant").ToList(); ViewBag.Employees = db.Employees; return(View(vm)); }