Esempio n. 1
0
 /// <summary>
 /// 获取系统部门树节点
 /// </summary>
 public ActionResult GetTree()
 {
     var departmentService = new SystemDepartmentService();
     var dics = departmentService.GetEnabledList();
     var nodes = TreeHelper.Build(dics, p => p.ParentId == 0, (node, instace) =>
     {
         node.IconCls = AuthHelper.GetDepartmentIconCls(instace);
     });
     return Json(nodes);
 }
Esempio n. 2
0
 /// <summary>
 /// 设置部门实体对象
 /// </summary>
 /// <param name="departmentId">部门主键</param>
 private void SetDepartmentEntity(int departmentId)
 {
     if (departmentId > 0)
     {
         var deptService = new SystemDepartmentService();
         var dept = deptService.Get(departmentId);
         ViewBag.DepartmentEntity = dept;
     }
 }