public ActionResult Edit(Employee employee) { ///Update employee employee.Type = EmployeeTypeDB.GetInstance().FindEmployeeType(employee.Type.Id); EmployeeDB.GetInstance().UpdateEmployee(employee); return(Redirect("Index")); }
public ActionResult Create(Employee employee) { employee.Type = EmployeeTypeDB.GetInstance().FindEmployeeType(employee.Type.Id); employee.Status = EmployeeStatusDB.GetInstance().FindEmployeeStatus(employee.Status.Id); EmployeeDB.GetInstance().AddEmployee(employee); return(Redirect("Index")); }
public ActionResult Edit(int employeeId) { EmployeeViewModel viewModel = new EmployeeViewModel() { Employee = EmployeeDB.GetInstance().FindEmployee(employeeId), EmployeeTypes = EmployeeTypeDB.GetInstance().GetEmployeeTypes() }; return(View(viewModel)); }
public ActionResult Create() { EmployeeViewModel viewModel = new EmployeeViewModel() { EmployeeTypes = EmployeeTypeDB.GetInstance().GetEmployeeTypes(), EmployeeStatuses = EmployeeStatusDB.GetInstance().GetEmployeeStatuses() }; return(View(viewModel)); }
// GET: EmployeeType public ActionResult Index() { return(View(EmployeeTypeDB.GetInstance().GetEmployeeTypes())); }
///HTTPPost DeleteAccepted will be hit if the user presses yes on the delete page above. public ActionResult DeleteAccepted(int employeeTypeId) { //Delete employee EmployeeTypeDB.GetInstance().DeleteEmployeeType(employeeTypeId); return(Redirect("Index")); }
public ActionResult Edit(EmployeeType employeeType) { ///Update employee EmployeeTypeDB.GetInstance().UpdateEmployeeType(employeeType); return(Redirect("Index")); }
public ActionResult Edit(int employeeTypeId) { EmployeeType emplT = EmployeeTypeDB.GetInstance().FindEmployeeType(employeeTypeId); return(View(emplT)); }
public ActionResult Create(EmployeeType employeeType) { EmployeeTypeDB.GetInstance().AddEmployeeType(employeeType); return(Redirect("Index")); }