public ActionResult RemoveEmployeeFromDepartment(ED.RemoveEmployeeFromDepartmentForm form) { if (ModelState.IsValid) { DepartmentService.RemoveEmployeeDepartment(form.SelectedEmployeeId, form.SelectedDepartmentId, SessionUser.GetUser().Id); } return(RedirectToAction("Index", "Employee")); }
public ActionResult RemoveEmployeeFromDepartment(int id) { List <SelectListItem> DepartmentList = new List <SelectListItem>(); foreach (C.Department dep in DepartmentService.GetEmployeeDepartments(id)) { DepartmentList.Add(new SelectListItem { Text = dep.Title, Value = dep.Id.ToString() }); } ED.RemoveEmployeeFromDepartmentForm form = new ED.RemoveEmployeeFromDepartmentForm { SelectedEmployeeId = id, DepartmentList = DepartmentList }; return(View(form)); }