private void IniDeptTree(Node node, int leavel, string parCode)
    {
        IList <SsbDept> lst = basDeptManager.GetEntityList(new SsbDept()
        {
            DeptLevel = leavel + 1, ParentId = Convert.ToInt32(parCode)
        }, "DISPLAY_ID");

        if (lst.Count == 0)
        {
            node.Icon = Icon.BuildingGo;
            node.Leaf = true;
            return;
        }
        foreach (SsbDept m in lst)
        {
            Node n = IniNode(m);
            n.NodeID = m.ObjId.ToString();
            CheckNode(n);
            if (basDeptManager.GetRowCount(new SsbDept()
            {
                DeptLevel = leavel + 2, ParentId = m.ObjId
            }) == 0)
            {
                n.Icon = Icon.BuildingGo;
                n.Leaf = true;
            }
            else
            {
                n.Icon = Icon.Building;
                n.Leaf = false;
            }
            node.Children.Add(n);
        }
    }
Example #2
0
    /// <summary>
    /// 嵌套查询部门树
    /// </summary>
    /// <param name="noderoot"></param>
    /// <param name="table"></param>
    private void buildTree(Node noderoot, IList <SsbDept> deptList)
    {
        foreach (SsbDept dept in deptList)
        {
            Ext.Net.Node node = new Ext.Net.Node();
            node.NodeID = dept.ObjId.ToString();
            node.Text   = dept.DeptName;
            node.CustomAttributes.Add(new ConfigItem("OBJID", dept.ObjId.ToString(), ParameterMode.Value));
            node.CustomAttributes.Add(new ConfigItem("DELETE_FLAG", dept.DeleteFlag.ToString(), ParameterMode.Value));
            node.CustomAttributes.Add(new ConfigItem("DEPT_NAME", dept.DeptName, ParameterMode.Value));

            IList <SsbDept> subDeptList = deptManager.GetEntityList(new SsbDept()
            {
                ParentId = dept.ObjId
            });
            node.Leaf = subDeptList.Count == 0;
            buildTree(node, subDeptList);
            noderoot.Children.Add(node);
        }
    }
Example #3
0
    public void commandcolumn_direct_edit(string obj_id)
    {
        #region 清空界面
        modify_objid.Text           = string.Empty;
        modify_user_code.Text       = string.Empty;
        modify_user_name.Text       = string.Empty;
        modify_real_name.Text       = string.Empty;
        modify_telNum.Text          = string.Empty;
        modify_dept.Text            = string.Empty;
        modify_work.Text            = string.Empty;
        modify_class.Text           = string.Empty;
        modify_shift.Text           = string.Empty;
        modify_workshop.Text        = string.Empty;
        modify_remark.Text          = string.Empty;
        hidden_modify_dept.Text     = string.Empty;
        hidden_modify_work.Text     = string.Empty;
        hidden_modify_workshop.Text = string.Empty;
        #endregion

        #region 获取信息
        SsbUser user = userManager.GetByObjId(Convert.ToInt32(obj_id));
        #endregion

        #region 设置界面
        modify_objid.Value     = user.ObjId;
        modify_user_name.Value = user.UserName;
        modify_real_name.Value = user.RealName;
        modify_sex.Select(user.Sex.ToString());
        modify_telNum.Value      = user.Telephone;
        modify_user_code.Value   = user.WorkBarcode;
        hidden_modify_dept.Value = user.DeptId;
        if (user.DeptId != null)
        {
            modify_dept.Value = deptManager.GetEntityList(new SsbDept()
            {
                ObjId = user.DeptId
            })[0].DeptName;
        }
        if (user.ClassId != null)
        {
            modify_class.Value = user.ClassId.ToString();
        }
        if (user.ShiftId != null)
        {
            modify_shift.Value = user.ShiftId.ToString();
        }
        modify_remark.Value = user.Remark;
        this.winModify.Show();
        #endregion
    }
Example #4
0
    private void IniDeptTree(string role, Node node, int level, int parent_id)
    {
        node.NodeID = parent_id.ToString();
        IList <SsbDept> lst = basDeptManager.GetEntityList(new SsbDept()
        {
            DeptLevel = level + 1, ParentId = parent_id
        }, "DISPLAY_ID");

        if (lst.Count == 0)
        {
            node.Icon = Icon.BuildingGo;
            node.Leaf = true;
            return;
        }
        node.Icon = Icon.Building;
        node.Leaf = false;
        foreach (SsbDept m in lst)
        {
            Node n = IniNode(role, m);
            IniDeptTree(role, n, (int)m.DeptLevel, Convert.ToInt32(m.ObjId));
            node.Children.Add(n);
        }
    }
Example #5
0
    public string treePanelDeptLoad(string pageid)
    {
        IList <SsbDept> deptList = deptManager.GetEntityList(new SsbDept()
        {
            DeleteFlag = 0, ParentId = Convert.ToInt32(pageid)
        }, "OBJID ASC");
        NodeCollection nodes = new Ext.Net.NodeCollection();

        if (deptList.Count > 0)
        {
            foreach (SsbDept dept in deptList)
            {
                if (deptManager.GetEntityList(new SsbDept()
                {
                    ParentId = dept.ObjId, DeleteFlag = 0
                }).Count > 0)
                {
                    Node node = new Node();
                    node.NodeID = dept.ObjId.ToString();
                    node.Text   = dept.DeptName;
                    node.Icon   = Icon.Building;
                    node.Leaf   = false;
                    nodes.Add(node);
                }
                else
                {
                    Node node = new Node();
                    node.NodeID = dept.ObjId.ToString();
                    node.Text   = dept.DeptName;
                    node.Icon   = Icon.BuildingGo;
                    node.Leaf   = true;
                    nodes.Add(node);
                }
            }
        }
        return(nodes.ToJson());
    }