Ejemplo n.º 1
0
 public ActionResult RemoveEmployeeFromDepartment(ED.RemoveEmployeeFromDepartmentForm form)
 {
     if (ModelState.IsValid)
     {
         DepartmentService.RemoveEmployeeDepartment(form.SelectedEmployeeId, form.SelectedDepartmentId, SessionUser.GetUser().Id);
     }
     return(RedirectToAction("Index", "Employee"));
 }
Ejemplo n.º 2
0
        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));
        }