Example #1
0
    public string treePanelMenuPageLoad(string pageid)
    {
        SspPageMenu         mainPageMenu = pageMenuManager.GetByObjId(Convert.ToInt32(pageid));
        IList <SspPageMenu> pageMenuList = pageMenuManager.GetMainPageMenuList(mainPageMenu.MenuLevel, mainPageMenu.MenuLevel.Length + 2);
        NodeCollection      nodes        = new Ext.Net.NodeCollection();

        if (pageMenuList.Count > 0)
        {
            foreach (SspPageMenu pageMenu in pageMenuList)
            {
                if (pageMenuManager.GetMainPageMenuList(pageMenu.MenuLevel, pageMenu.MenuLevel.Length + 2).Count > 0)
                {
                    Node node = new Node();
                    node.NodeID = pageMenu.ObjId.ToString();
                    node.Text   = pageMenu.ShowName;
                    node.Icon   = Icon.FolderLink;
                    node.Leaf   = false;
                    nodes.Add(node);
                }
                else
                {
                    Node node = new Node();
                    node.NodeID = pageMenu.ObjId.ToString();
                    node.Text   = pageMenu.ShowName;
                    node.Icon   = Icon.FolderLink;
                    node.Leaf   = true;
                    nodes.Add(node);
                }
            }
        }
        return(nodes.ToJson());
    }
        public string GetNodes(string node)
        {
            NodeCollection nodes = new NodeCollection(false);

            if (!string.IsNullOrEmpty(node))
            {
                for (int i = 1; i < 6; i++)
                {
                    Node asyncNode = new Node();
                    asyncNode.Text = node + i;
                    asyncNode.NodeID = node + i;
                    nodes.Add(asyncNode);
                }

                for (int i = 6; i < 11; i++)
                {
                    Node treeNode = new Node();
                    treeNode.Text = node + i;
                    treeNode.NodeID = node + i;
                    treeNode.Leaf = true;
                    nodes.Add(treeNode);
                }
            }

            return nodes.ToJson();
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            string nodeId = context.Request["node"];

            if (!string.IsNullOrEmpty(nodeId))
            {
                NodeCollection nodes = new NodeCollection(false);

                for (int i = 1; i < 6; i++)
                {
                    Node asyncNode = new Node();
                    asyncNode.Text = nodeId + i;
                    asyncNode.NodeID = nodeId + i;
                    nodes.Add(asyncNode);
                }

                for (int i = 6; i < 11; i++)
                {
                    Node node = new Node();
                    node.Text = nodeId + i;
                    node.NodeID = nodeId + i;
                    node.Leaf = true;
                    nodes.Add(node);
                }

                context.Response.Write(nodes.ToJson());
                context.Response.End();
            }
        }
Example #4
0
    public string NodeLoad(string nodeID)
    {
        DataTable      dt       = BG_DepartmentLogic.GetAllBG_Department(AreaDepID);
        NodeCollection nodes    = new Ext.Net.NodeCollection();
        Node           rootNode = new Node();

        rootNode.Text = "部门管理";
        rootNode.Icon = Icon.Folder;
        nodes.Add(rootNode);
        rootNode.Expanded = true;
        List <string> listdep = new List <string>();

        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string depname = dt.Rows[i]["DepName"].ToString();

                string depid = dt.Rows[i]["DepID"].ToString();
                listdep.Add(depname);
                Node node1 = new Node();
                node1.NodeID = dt.Rows[i]["DepID"].ToString();
                node1.Text   = depname;
                node1.Icon   = Icon.UserHome;
                int sedepid = common.IntSafeConvert((int)Session["depid"]);
                if (sedepid == common.IntSafeConvert(dt.Rows[i]["DepID"]))
                {
                    node1.Expanded = true;
                }
                //node1.Leaf = true;
                rootNode.Children.Add(node1);
                DataTable dt1 = BG_UserLogic.GetDtUserByDepid(depid);
                if (dt1.Rows.Count > 0)
                {
                    for (int j = 0; j < dt1.Rows.Count; j++)
                    {
                        Node node2 = new Node();
                        node2.NodeID = dt1.Rows[j]["UserID"].ToString() + "用户";
                        node2.Text   = dt1.Rows[j]["UserName"].ToString();
                        node2.Icon   = Icon.User;
                        node2.Leaf   = true;
                        node1.Children.Add(node2);
                    }
                }
                else
                {
                    node1.EmptyChildren = true;
                }
            }
        }
        Session["sedep"] = listdep;
        return(nodes.ToJson());
    }
Example #5
0
        public string BuildTree(int id)
        {
            object activeModule = _systemService.SessionHelper.Get("ActiveModule");

            if (activeModule != null && activeModule.ToString() == id.ToString())
            {
                return("Stop");
            }
            //setting session and continue
            _systemService.SessionHelper.Set("ActiveModule", id);
            Ext.Net.NodeCollection nodes = null;
            nodes = TreeBuilder.Instance.BuildEmployeeDetailsTree(commonTree.Root);
            return(nodes.ToJson());

            switch (id)
            {
            case 1:
                nodes = TreeBuilder.Instance.BuildEmployeeFilesTree(commonTree.Root);
                tabHome.Loader.Url = "Employees.aspx";
                tabHome.Loader.LoadContent();
                return(nodes.ToJson());

            case 3:
                nodes = TreeBuilder.Instance.BuildCompanyStructureTree(commonTree.Root);
                tabHome.Loader.Url = "Departments.aspx";
                tabHome.Loader.LoadContent();
                return(nodes.ToJson());

            case 4:
                nodes = TreeBuilder.Instance.BuildTimeManagementTree(commonTree.Root);
                tabHome.Loader.Url = "Dashboard.aspx";
                tabHome.Loader.LoadContent();
                return(nodes.ToJson());

            default:
                nodes = TreeBuilder.Instance.BuildCaseManagementTree(commonTree.Root);
                return(nodes.ToJson());
            }
        }
        public string GenerarNodo(string strNodoID)
        {
            //1. Obtener las colonias del siguiente nivel
            List<Colonia> lColonias = ColoniaBusiness.ObtenerColoniasPorMunicipio(strNodoID);
            NodeCollection ncNivel = new NodeCollection();

            //2. Armar el arbol de hijos
            foreach (Colonia col in lColonias)
            {
                Node nCol = new Node();
                nCol.Text = col.Descripcion;
                nCol.NodeID = col.ID;
                nCol.Expanded = false;
                nCol.Expandable = false;
                ncNivel.Add(nCol);
            }
            //3. Regresar los nodos
            return ncNivel.ToJson();
        }
Example #7
0
    public string NodeLoad(string storeID, string nodeID)
    {
        NodeCollection nodes = new Ext.Net.NodeCollection();
        string         parid = sspPageMenuManager.GetEntityList(new SspPageMenu()
        {
            ObjId = Convert.ToInt32(nodeID)
        })[0].MenuLevel;
        IList <SspPageMenu> lst = this.sspPageMenuManager.GetUserMenuPageList(this.Data.User.UserId, parid);

        foreach (SspPageMenu menu in lst)
        {
            nodes.Add(IniTreeNode(menu));
        }
        if (lst.Count == 0)
        {
            Node treeNode = new Node();
            treeNode.NodeID = "无相关菜单=" + DateTime.Now.ToString("yyyyMMddHHmmss");
            treeNode.Text   = "无相关菜单";
            treeNode.Leaf   = true;
            nodes.Add(treeNode);
        }
        return(nodes.ToJson());
    }
Example #8
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());
    }
Example #9
0
        public string NodeLoadBis(string nodeID)
        {
            NodeCollection nodes = new Ext.Net.NodeCollection();

            if (!string.IsNullOrEmpty(nodeID))
            {
                string        _req = "select * from groupe where ssgroupeid=" + nodeID + " and clientid=" + this.getCurrentUser().getClientId();
                SqlDataReader dr   = Select(_req);
                IDictionary <string, string> listGroupe = new Dictionary <string, string>();
                while (dr.Read())
                {
                    listGroupe.Add(dr[0].ToString(), dr[1].ToString());
                }

                dr.Close();
                int countgroupe = 0, countvehicule = 0;

                for (int i = 0; i < listGroupe.Count; i++)
                {
                    Node asyncNode = new Node();
                    asyncNode.Text   = listGroupe.ElementAt(i).Value;
                    asyncNode.NodeID = listGroupe.ElementAt(i).Key;
                    string        _req11 = "select count(*) from groupe where ssgroupeid=" + listGroupe.ElementAt(i).Key + " and clientid=" + this.getCurrentUser().getClientId();
                    SqlDataReader dr11   = Select(_req11);
                    if (dr11.Read())
                    {
                        countgroupe = int.Parse(dr11[0].ToString());
                    }
                    dr11.Close();

                    string        _reqvehicule = "select count(*) from groupe_vehicule gv,vehicules v where gv.vehiculeid=v.vehiculeid and gv.actif='1' and groupeid=" + listGroupe.ElementAt(i).Key + " and gv.clientid=" + this.getCurrentUser().getClientId();
                    SqlDataReader drvehicule   = Select(_reqvehicule);
                    if (drvehicule.Read())
                    {
                        countvehicule = int.Parse(drvehicule[0].ToString());
                    }
                    drvehicule.Close();
                    if (countgroupe == 0 && countvehicule == 0)
                    {
                        asyncNode.EmptyChildren = true;
                    }

                    nodes.Add(asyncNode);
                }

                if (nodeID == racine)
                {
                    string _req0 = "select vehiculeid,matricule,typevehiculeid from vehicules where actif='1' and clientid=" + this.getCurrentUser().getClientId() + " and vehiculeid not in (select vehiculeid from groupe_vehicule where actif='1' and clientid=" + this.getCurrentUser().getClientId() + ")";

                    System.Data.SqlClient.SqlDataReader dr0 = Select(_req0);

                    while (dr0.Read())
                    {
                        Node asyncNode1 = new Node();
                        asyncNode1.Text   = dr0[1].ToString() + " <img src=\"../../Ressources/Images/backtest.png\"";
                        asyncNode1.NodeID = dr0[0].ToString();
                        asyncNode1.Leaf   = true;
                        if (int.Parse(dr0[2].ToString()) == 1)
                        {
                            asyncNode1.IconCls = "V_Rouge";
                        }
                        else if (int.Parse(dr0[2].ToString()) == 2)
                        {
                            asyncNode1.IconCls = "Cam_Rouge";
                        }
                        asyncNode1.Checked = false;
                        nodes.Add(asyncNode1);
                    }

                    dr0.Close();
                }
                //string _req1 = "select v.vehiculeid,v.matricule,v.typevehiculeid from groupe_vehicule gv,vehicules v where gv.vehiculeid=v.vehiculeid and groupeid=" + nodeID + " and gv.actif='1' and v.actif='1' and gv.clientid=" + this.getCurrentUser().getClientId();
                string _req1 = "select b.imei,v.matricule,v.typevehiculeid from groupe_vehicule gv,vehicules v ,boitier b, affectation_vehicule_boitier avb where v.vehiculeid=avb.vehiculeid and b.boitierid=avb.boitierid and gv.vehiculeid=v.vehiculeid and groupeid=" + nodeID + " and avb.actif='1' and gv.actif='1' and v.actif='1' and gv.clientid=" + this.getCurrentUser().getClientId();

                System.Data.SqlClient.SqlDataReader dr1 = Select(_req1);

                while (dr1.Read())
                {
                    Node asyncNode1 = new Node();
                    asyncNode1.Text   = dr1[1].ToString() + " <img src=\"../../Ressources/Images/backtest.png\"";
                    asyncNode1.NodeID = dr1[0].ToString();
                    asyncNode1.Leaf   = true;
                    if (int.Parse(dr1[2].ToString()) == 1)
                    {
                        asyncNode1.IconCls = "V_Rouge";
                    }
                    else if (int.Parse(dr1[2].ToString()) == 2)
                    {
                        asyncNode1.IconCls = "Cam_Rouge";
                    }
                    asyncNode1.Checked = false;
                    nodes.Add(asyncNode1);
                }

                dr1.Close();
            }
            else
            {
            }
            return(nodes.ToJson());
        }
Example #10
0
        public string NodeLoad(string nodeID)
        {
            NodeCollection nodes = new Ext.Net.NodeCollection();

            if (!string.IsNullOrEmpty(nodeID))
            {
                // récupérer l'id de l'uilisateur


                // requete sql qui me retourne tous les vehicule et tous les groupes liés à cet id et que l'utilisateur  a le droit de consulter

                String        _reqGrp = "select g.groupeid, g.libelle from groupe g inner join Groupe_Profil gp on gp.groupeid = g.groupeid and gp.actif = '1' inner join profil p on p.profilid = gp.profilid and p.actif = '1' inner join profil_user pu on pu.actif = '1' and pu.profilid = p.profilid where g.ssgroupeid = " + nodeID + "and g.clientid = " + this.getCurrentUser().getClientId() + "   and g.actif = '1' and pu.utilisateurid =  " + this.getCurrentUser().getUserId() + " group by  g.groupeid, g.libelle";
                SqlDataReader drG     = Select(_reqGrp);


                // construction du Json nodes
                IDictionary <string, string> listGroupe = new Dictionary <string, string>();
                while (drG.Read())
                {
                    listGroupe.Add(drG[0].ToString(), drG[1].ToString());
                }
                drG.Close();

                for (int i = 0; i < listGroupe.Count; i++)
                {
                    Node asyncNode = new Node();
                    asyncNode.Text   = listGroupe.ElementAt(i).Value;
                    asyncNode.NodeID = listGroupe.ElementAt(i).Key;
                    nodes.Add(asyncNode);
                }



                //string _reqVeh = "select * from (select aff.* from (select v.vehiculeid, v.matricule, v.typevehiculeid ,d.contact , isnull(gv.groupeid, 1) as groupeid from vehicules v left outer join groupe_vehicule gv on gv.vehiculeid = v.vehiculeid and gv.actif = '1'  inner join affectation_vehicule_boitier abv on abv.vehiculeid=v.vehiculeid inner join boitier b on b.boitierid=abv.boitierid inner join Datatracker d on d.imei=b.imei  where v.clientid = " + this.getCurrentUser().getClientId() + " and v.actif = '1' )aff union select v.vehiculeid, v.matricule, v.typevehiculeid ,d.contact , 1 as groupeid   from vehicules v inner join  profil_vehicule pv on pv.vehiculeid = v.vehiculeid and pv.actif = '1' inner join profil p on p.profilid = pv.profilid and p.actif ='1'   inner join affectation_vehicule_boitier abv on abv.vehiculeid=v.vehiculeid inner join boitier b on b.boitierid=abv.boitierid inner join Datatracker d on d.imei=b.imei inner join profil_user pu on pu.actif = '1' and pu.profilid = p.profilid where  pu.utilisateurid = " + this.getCurrentUser().getUserId() + " and  v.clientid = " + this.getCurrentUser().getClientId() + " and v.actif = '1') aff2 where groupeid =" + nodeID;
                //SqlDataReader drV = Select(_reqVeh);
                string _reqVeh = " select * from (select *, (select top 1 contact from Datatracker where imei = aff2.imei order by datatrackerid desc) as dernier_contact ,(select top 1 signialGPS  from Datatracker where imei = aff2.imei order by datatrackerid desc) as signal from (select aff.* from "
                                 + "(select v.vehiculeid, v.matricule, v.typevehiculeid , isnull(gv.groupeid, 1) as groupeid , b.imei"
                                 + " from vehicules v"
                                 + " left outer join groupe_vehicule gv on gv.vehiculeid = v.vehiculeid and gv.actif = '1'"
                                 + " inner join affectation_vehicule_boitier abv on abv.vehiculeid=v.vehiculeid "
                                 + " inner join boitier b on b.boitierid=abv.boitierid"
                                 + " where v.clientid = " + this.getCurrentUser().getClientId() + " and v.actif = '1' )aff "
                                 + " union "
                                 + " select v.vehiculeid, v.matricule, v.typevehiculeid ,1 as groupeid  , b.imei from vehicules v  inner join  profil_vehicule pv on pv.vehiculeid = v.vehiculeid and pv.actif = '1'  inner join profil p on p.profilid = pv.profilid and p.actif ='1'   inner join affectation_vehicule_boitier abv on abv.vehiculeid=v.vehiculeid  inner join boitier b on b.boitierid=abv.boitierid  inner join profil_user pu on pu.actif = '1' and pu.profilid = p.profilid where  pu.utilisateurid = " + this.getCurrentUser().getUserId() + " and  v.clientid = " + this.getCurrentUser().getClientId() + " and v.actif = '1' ) aff2  where groupeid =" + nodeID + ")t where t.dernier_contact is not null";

                SqlDataReader drV = Select(_reqVeh);

                while (drV.Read())
                {
                    Node asyncNode1 = new Node();

                    if ((int)drV[5] == 0)
                    {
                        if ((int)drV[6] < 10)
                        {
                            asyncNode1.Text = drV[1].ToString() + " <img src=\"../../Ressources/Images/OFFimg1.png\"";
                        }
                        else if ((int)drV[6] < 80)
                        {
                            asyncNode1.Text = drV[1].ToString() + " <img src=\"../../Ressources/Images/OFFimg2.png\"";
                        }
                        else
                        {
                            asyncNode1.Text = drV[1].ToString() + " <img src=\"../../Ressources/Images/OFFimg3.png\"";
                        }
                    }
                    else
                    {
                        if ((int)drV[6] < 10)
                        {
                            asyncNode1.Text = drV[1].ToString() + " <img src=\"../../Ressources/Images/ONimg1.png\"";
                        }
                        else if ((int)drV[6] < 80)
                        {
                            asyncNode1.Text = drV[1].ToString() + " <img src=\"../../Ressources/Images/ONimg2.png\"";
                        }
                        else
                        {
                            asyncNode1.Text = drV[1].ToString() + " <img src=\"../../Ressources/Images/ONimg3.png\"";
                        }
                    }


                    asyncNode1.NodeID = drV[0].ToString();
                    asyncNode1.Leaf   = true;
                    if (int.Parse(drV[2].ToString()) == 1)
                    {
                        asyncNode1.IconCls = "camioncls";
                    }
                    else if (int.Parse(drV[2].ToString()) == 2)
                    {
                        asyncNode1.IconCls = "voiturecls";
                    }
                    asyncNode1.Checked = false;
                    nodes.Add(asyncNode1);
                }

                drV.Close();
            }
            else
            {
            }

            return(nodes.ToJson());
        }
    public string RefreshMenu()
    {
        Ext.Net.NodeCollection nodes = this.BuildTree(null);

        return(nodes.ToJson());
    }
    public string NodeLoad(string nodeID)
    {
        DataTable dt = BG_DepartmentLogic.GetAllBG_Department(AreaDepID);
        NodeCollection nodes = new Ext.Net.NodeCollection();
        Node rootNode = new Node();
        rootNode.Text = "部门管理";
        rootNode.Icon = Icon.Folder;
        nodes.Add(rootNode);
        rootNode.Expanded = true;
        List<string> listdep = new List<string>();
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string depname = dt.Rows[i]["DepName"].ToString();

                string depid = dt.Rows[i]["DepID"].ToString();
                listdep.Add(depname);
                Node node1 = new Node();
                node1.NodeID = dt.Rows[i]["DepID"].ToString();
                node1.Text = depname;
                node1.Icon = Icon.UserHome;
                int sedepid = common.IntSafeConvert((int)Session["depid"]);
                if (sedepid == common.IntSafeConvert(dt.Rows[i]["DepID"]))
                {
                    node1.Expanded = true;
                }
                //node1.Leaf = true;
                rootNode.Children.Add(node1);
                DataTable dt1 = BG_UserLogic.GetDtUserByDepid(depid);
                if (dt1.Rows.Count > 0)
                {
                    for (int j = 0; j < dt1.Rows.Count; j++)
                    {
                        Node node2 = new Node();
                        node2.NodeID = dt1.Rows[j]["UserID"].ToString()+"用户";
                        node2.Text = dt1.Rows[j]["UserName"].ToString();
                        node2.Icon = Icon.User;
                        node2.Leaf = true;
                        node1.Children.Add(node2);
                    }
                }
                else
                {
                    node1.EmptyChildren = true;
                }

            }
        }
        Session["sedep"] = listdep;
        return nodes.ToJson();
    }
    public string NodeLoad(string NodeID)
    {
        if (!ISNode(NodeID))
        {
            return "failure";
        }
        NodeCollection nodes = new NodeCollection();
        int tem = 1;
        int nodeID = common.IntSafeConvert(NodeID);
        string Financial_allocation = "财政拨款";
        string Other_funds = "其他资金";
        string BasicIncome = "基本支出";
        string ProjectIncome = "项目支出";
        Node rootNode = new Node();
        Node nodeO = new Node();
        Node nodeF = new Node();
        Node nodeFB = new Node();
        Node nodeFP = new Node();
        Node nodeOB = new Node();
        Node nodeOP = new Node();
        //if (NodeID == "root")
        //{
        //    rootNode.Text = "经济科目";
        //    rootNode.NodeID = "PA";
        //    rootNode.Icon = Icon.Folder;
        //    nodes.Add(rootNode);
        //    rootNode.Expanded = true;
        //}
        //else if (NodeID == "PA")
        //{
        //    if (SingleNode(NodeID) == 2)
        //    {
        //        nodeF.NodeID = "nodeF";
        //        nodeF.Text = Financial_allocation;
        //        nodeF.Icon = Icon.Folder;
        //        nodes.Add(nodeF);
        //        nodeF.Expanded = true;
        //    }
        //    //else if (SingleNode(NodeID) == 1)
        //    //{
        //    //    nodeO.NodeID = "nodeO";
        //    //    nodeO.Text = Other_funds;
        //    //    nodeO.Icon = Icon.Folder;
        //    //    nodes.Add(nodeO);
        //    //    nodeO.Expanded = true;
        //    //}
        //    else if (SingleNode(NodeID) == 3)
        //    {
        //        nodeF.NodeID = "nodeF";
        //        nodeF.Text = Financial_allocation;
        //        nodeF.Icon = Icon.Folder;
        //        nodes.Add(nodeF);
        //        //nodeO.NodeID = "nodeO";
        //        //nodeO.Text = Other_funds;
        //        //nodeO.Icon = Icon.Folder;
        //        //nodes.Add(nodeO);
        //        //nodeO.Expanded = true;
        //        nodeF.Expanded = true;
        //    }
        //}
        //else if (NodeID == "nodeF")
        //{
        //    //if (SingleNode(NodeID) == 21)
        //    //{
        //    //    nodeFB.NodeID = "nodeFB";
        //    //    nodeFB.Text = BasicIncome;
        //    //    nodeFB.Icon = Icon.Folder;
        //    //    nodes.Add(nodeFB);
        //    //    nodeFB.Expanded = true;
        //    //}
        //    //else if (SingleNode(NodeID) == 22)
        //    //{
        //    //    nodeFP.NodeID = "nodeFP";
        //    //    nodeFP.Text = ProjectIncome;
        //    //    nodeFP.Icon = Icon.Folder;
        //    //    nodes.Add(nodeFP);
        //    //    nodeFP.Expanded = true;
        //    //}
        //    //else if (SingleNode(NodeID) == 23)
        //    //{
        //    //    nodeFB.NodeID = "nodeFB";
        //    //    nodeFB.Text = BasicIncome;
        //    //    nodeFB.Icon = Icon.Folder;
        //    //    nodes.Add(nodeFB);

        //    //    nodeFP.NodeID = "nodeFP";
        //    //    nodeFP.Text = ProjectIncome;
        //    //    nodeFP.Icon = Icon.Folder;
        //    //    nodes.Add(nodeFP);
        //    //    nodeFB.Expanded = true;
        //    //    nodeFP.Expanded = true;
        //    //}
        //    nodeFB.NodeID = "nodeFB";
        //    nodeFB.Text = BasicIncome;
        //    nodeFB.Icon = Icon.Folder;
        //    nodes.Add(nodeFB);
        //    nodeFB.Expanded = true;
        //}
        //else if (NodeID == "nodeO")
        //{
        //    if (SingleNode(NodeID) == 11)
        //    {
        //        nodeOB.NodeID = "nodeOB";
        //        nodeOB.Text = BasicIncome;
        //        nodeOB.Icon = Icon.Folder;
        //        nodes.Add(nodeOB);
        //        nodeOB.Expanded = true;
        //    }
        //    else if (SingleNode(NodeID) == 12)
        //    {
        //        nodeOP.NodeID = "nodeOP";
        //        nodeOP.Text = ProjectIncome;
        //        nodeOP.Icon = Icon.Folder;
        //        nodes.Add(nodeOP);
        //        nodeOP.Expanded = true;
        //    }
        //    else if (SingleNode(NodeID) == 13)
        //    {
        //        nodeOB.NodeID = "nodeOB";
        //        nodeOB.Text = BasicIncome;
        //        nodeOB.Icon = Icon.Folder;
        //        nodes.Add(nodeOB);
        //        nodeOP.NodeID = "nodeOP";
        //        nodeOP.Text = ProjectIncome;
        //        nodeOP.Icon = Icon.Folder;
        //        nodes.Add(nodeOP);
        //        nodeOB.Expanded = true;
        //        nodeOP.Expanded = true;
        //    }
        //}
        if (NodeID == "root")
        {
            SetNode(tem, Financial_allocation, BasicIncome, nodes);
        }
        //else if (NodeID == "nodeFP")
        //{
        //    SetNode(tem, Financial_allocation, ProjectIncome, nodes);
        //}
        //else if (NodeID == "nodeOB")
        //{
        //    SetNode(tem, Other_funds, BasicIncome, nodes);
        //}
        //else if (NodeID == "nodeOP")
        //{
        //    SetNode(tem, Other_funds, ProjectIncome, nodes);
        //}
        if (nodeID >= 1000)
        {
            SetNode(nodeID, nodes);
        }
        Session["Slist"] = HidSlist.Text;
        return nodes.ToJson();
    }
Example #14
0
        public string BuildTree(int id)
        {
            object activeModule = _systemService.SessionHelper.Get("ActiveModule");

            if (activeModule != null && activeModule.ToString() == id.ToString())
            {
                return("Stop");
            }
            //setting session and continue
            _systemService.SessionHelper.Set("ActiveModule", id);
            Ext.Net.NodeCollection nodes = null;
            switch (id)
            {
            case 1:
                nodes = TreeBuilder.Instance.BuildEmployeeFilesTree(commonTree.Root);
                tabHome.Loader.Url = "Dashboard.aspx";
                tabHome.Loader.LoadContent();
                return(nodes.ToJson());

            case 3:
                nodes = TreeBuilder.Instance.BuildCompanyStructureTree(commonTree.Root);
                tabHome.Loader.Url = "Dashboard.aspx";
                tabHome.Loader.LoadContent();
                return(nodes.ToJson());

            case 4:
                nodes = TreeBuilder.Instance.BuildTimeManagementTree(commonTree.Root);
                tabHome.Loader.Url = "Dashboard.aspx";
                tabHome.Loader.LoadContent();
                return(nodes.ToJson());

            case 5:
                nodes = TreeBuilder.Instance.BuildReportsTree(commonTree.Root);
                tabHome.Loader.Url = "Dashboard.aspx";
                tabHome.Loader.LoadContent();
                return(nodes.ToJson());

            case 6:
                nodes = TreeBuilder.Instance.BuildPayrollTree(commonTree.Root);
                tabHome.Loader.Url = "Dashboard.aspx";
                tabHome.Loader.LoadContent();
                return(nodes.ToJson());

            case 7:
                nodes = TreeBuilder.Instance.BuildSelftService(commonTree.Root);

                if (_systemService.SessionHelper.GetUserType() != 4)
                {
                    tabHome.Loader.Url = "Dashboard.aspx";
                }
                else
                {
                    ClassPermissionRecordRequest classReq = new ClassPermissionRecordRequest();
                    classReq.ClassId = "81101";

                    classReq.UserId = _systemService.SessionHelper.GetCurrentUserId();
                    RecordResponse <ModuleClass> modClass = _accessControlService.ChildGetRecord <ModuleClass>(classReq);
                    if (modClass.result.accessLevel == 0)
                    {
                        tabHome.Loader.Url = "BlankPage.aspx";
                    }
                    else
                    {
                        tabHome.Loader.Url = "Dashboard.aspx";
                    }
                }
                tabHome.Loader.LoadContent();
                return(nodes.ToJson());

            case 8:
                nodes = TreeBuilder.Instance.BuildAdminTemplates(commonTree.Root);
                tabHome.Loader.Url = "Dashboard.aspx";
                tabHome.Loader.LoadContent();
                return(nodes.ToJson());

            case 9:
                nodes = TreeBuilder.Instance.BuildAdminTemplates(commonTree.Root);
                tabHome.Loader.Url = "Dashboard.aspx";
                tabHome.Loader.LoadContent();
                return(nodes.ToJson());

            default:
                nodes = TreeBuilder.Instance.BuildCaseManagementTree(commonTree.Root);
                return(nodes.ToJson());
            }
        }