public ActionResult ViewTimeSheets() { var model = new ViewTimeSheetVM(); var ops = FileManager.CreateTimeSheetOperations(); var empDD = ops.GetAllEmployees(); model.CreateEmployeeList(empDD); return View(model); }
public ActionResult ViewTimeSheets(int SelectedEmployeeID) { var model = new ViewTimeSheetVM(); var ops = FileManager.CreateTimeSheetOperations(); var timeEntries = ops.GetAllTimeEntriesForOneEmp(SelectedEmployeeID); var employee = ops.SelectOneEmployee(SelectedEmployeeID); model.TimeEntries = timeEntries.Data; model.Message = timeEntries.Message; model.employee = employee; var empDD = ops.GetAllEmployees(); model.CreateEmployeeList(empDD); return View(model); }
public ActionResult AddTimeSheets(TimeEntry timeEntry, int SelectedEmployeeID) { var ops = FileManager.CreateTimeSheetOperations(); timeEntry.EmpID = SelectedEmployeeID; var empDD = ops.GetAllEmployees(); ops.AddTimeSheets(timeEntry); ViewTimeSheetVM model = new ViewTimeSheetVM(); var timeEntries = ops.GetAllTimeEntriesForOneEmp(SelectedEmployeeID); var employee = ops.SelectOneEmployee(SelectedEmployeeID); model.TimeEntries = timeEntries.Data; model.Message = timeEntries.Message; model.employee = employee; model.CreateEmployeeList(empDD); model.employee.EmpID= SelectedEmployeeID; return View("ViewTimeSheets", model); }