public ActionResult clockOut(int id) { Dictionary <string, object> model = new Dictionary <string, object>(); Employee selectedEmployee = Employee.Find(id); Hour clockOutHour = Hour.Find(selectedEmployee.id); int lastId = clockOutHour.GetId(); clockOutHour.ClockOut(lastId); clockOutHour.Hours(selectedEmployee.id); model.Add("selectedEmployee", selectedEmployee); return(RedirectToAction("Details", "Employee", new { employeeId = selectedEmployee.id })); }
public ActionResult clockOut(int id) { Dictionary <string, object> model = new Dictionary <string, object>(); Employee foundEmployee = Employee.Find(id); Hour newHour = Hour.Find(foundEmployee.id); newHour.ClockOut(foundEmployee.id); newHour.Hours(foundEmployee.id); model.Add("foundEmployee", foundEmployee); model.Add("newHour", newHour); return(RedirectToAction("Details")); }