public ActionResult DeleteConfirmed(int id) { EmployeeDepartmentAssignment employeeDepartmentAssignment = _employeeDepartmentAssignmentService.GetById(id); _employeeDepartmentAssignmentService.Delete(employeeDepartmentAssignment.ID); return(RedirectToAction("Index")); }
public ActionResult Edit(EmployeeDepartmentAssignment employeeDepartmentAssignment) { if (ModelState.IsValid) { _employeeDepartmentAssignmentService.Update(employeeDepartmentAssignment); return(RedirectToAction("Index")); } ViewBag.DepartmentID = new SelectList(_departmentService.Get(x => x.ToList().OrderBy(d => d.ShortName).ToList()), "ID", "FullName", employeeDepartmentAssignment.DepartmentID); ViewBag.EmployeeID = new SelectList(_employeeService.Get(x => x.ToList().OrderBy(e => e.FullName).ToList()), "ID", "FullName", employeeDepartmentAssignment.EmployeeID); return(View(employeeDepartmentAssignment)); }
public ActionResult Delete(int?id) { if (id == null) { return(StatusCode(StatusCodes.Status400BadRequest)); } EmployeeDepartmentAssignment employeeDepartmentAssignment = _employeeDepartmentAssignmentService.GetById(id.Value); if (employeeDepartmentAssignment == null) { return(StatusCode(StatusCodes.Status404NotFound)); } return(View(employeeDepartmentAssignment)); }
public ActionResult Edit(int?id) { if (id == null) { return(StatusCode(StatusCodes.Status400BadRequest)); } EmployeeDepartmentAssignment employeeDepartmentAssignment = _employeeDepartmentAssignmentService.GetById(id.Value); if (employeeDepartmentAssignment == null) { return(StatusCode(StatusCodes.Status404NotFound)); } ViewBag.DepartmentID = new SelectList(_departmentService.Get(x => x.ToList().OrderBy(d => d.ShortName).ToList()), "ID", "FullName", employeeDepartmentAssignment.DepartmentID); ViewBag.EmployeeID = new SelectList(_employeeService.Get(x => x.ToList().OrderBy(e => e.FullName).ToList()), "ID", "FullName", employeeDepartmentAssignment.EmployeeID); return(View(employeeDepartmentAssignment)); }