public ActionResult AdUser(string userId = "") { var dpList = new List <SelectListItem>(); var list = HomeBusiness.GetAllDepartmentName(); if (list != null & list.Count > 0) { foreach (var dp in list) { var item = new SelectListItem(); item.Text = dp.text; item.Value = dp.id; dpList.Add(item); } } ViewBag.dpList = dpList; ViewBag.userId = userId; return(View()); }
//TODO:CPF public ActionResult AdSetDepartments() { //获取根部门 var rootDepartment = HomeBusiness.GetRootDepartment(); ViewBag.RootDepartment = rootDepartment; var dpList = new List <SelectListItem>(); var list = HomeBusiness.GetAllDepartmentName(); if (list != null & list.Count > 0) { foreach (var dp in list) { var item = new SelectListItem(); item.Text = dp.text; item.Value = dp.id; dpList.Add(item); } } ViewBag.dpList = dpList; return(View(rootDepartment)); }
public ActionResult GetAllDepartment() { var list = HomeBusiness.GetAllDepartmentName(); return(Json(new { results = JsonHelper.Serializer <List <OrganizationSearch> >(list) }, JsonRequestBehavior.AllowGet)); }