Пример #1
0
        public static void CreaTree(Microsoft.Web.UI.WebControls.TreeView tree, int open, bool search, UserConfig uc)
        {
            string queryCat;

            queryCat = "SELECT * FROM CATALOGCATEGORIES WHERE PARENTID = 0";
            DataSet dsC = DatabaseConnection.CreateDataset(queryCat);

            foreach (DataRow dr in dsC.Tables[0].Rows)
            {
                TreeNode tv = new TreeNode();
                if (search)
                {
                    tv.Text = "<a href=\"javascript:copyDataS('" + dr["Id"].ToString() + "', '" + dr["Description"].ToString() + "')\" style=\"color:black;text-decoration:none\">" + dr["Description"].ToString() + "</a>";
                }
                else
                {
                    tv.Text = "<a href=\"javascript:copyData('" + dr["Id"].ToString() + "', '" + dr["Description"].ToString() + "')\" style=\"color:black;text-decoration:none\">" + dr["Description"].ToString() + "</a>";
                }
                tv.NodeData = dr["Id"].ToString();

                tv.Expanded = FillCategoryTree(Convert.ToInt32(dr["Id"]), tv, open, search, uc);                 // Chiamata ricorsiva per fare le foglie

                tree.Nodes.Add(tv);
            }
            tree.CssClass = "normal";
        }
Пример #2
0
        private Microsoft.Web.UI.WebControls.TreeNode addDocumentoNode(Microsoft.Web.UI.WebControls.TreeNode parentNode, DocsPaWR.AnelloDocumentale anelloDoc)
        {
            try
            {
                Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();

                node.Text = anelloDoc.infoDoc.segnatura;
                //node.ID=m_nodeIndex.ToString();


                if (parentNode != null)
                {
                    //aggiungo il nuovo nodo al nodo padre
                    parentNode.Nodes.Add(node);
                }
                else
                {
                    catenaDoc.Nodes.Add(node);
                }

                return(node);
            }
            catch (System.Exception es)
            {
                ErrorManager.redirect(this, es);
            }
            return(null);
        }
Пример #3
0
        //邦定任意节点
        public void CreateNode(int parentid, Microsoft.Web.UI.WebControls.TreeNode parentnode, DataTable dt)
        {
            DataRow[] drs = dt.Select("ParentID= " + parentid);//选出所有子节点
            foreach (DataRow r in drs)
            {
                string ClassID   = r["CategoryId"].ToString();
                string ClassDesc = r["Name"].ToString();
                string ParentId  = r["ParentId"].ToString();
                //string Orders = r["Orders"].ToString();
                //string IsShow = r["IsShow"].ToString();


                Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
                node.Text     = ClassDesc;
                node.NodeData = ClassID;
                //node.NavigateUrl = url;
                //node.Target = TargetFrame;
                //node.ImageUrl = imageurl;
                node.Expanded = true;
                int sonparentid = int.Parse(ClassID);    // or =location

                if (parentnode == null)
                {
                    TreeView1.Nodes.Clear();
                    parentnode = new Microsoft.Web.UI.WebControls.TreeNode();
                    TreeView1.Nodes.Add(parentnode);
                }
                parentnode.Nodes.Add(node);
                CreateNode(sonparentid, node, dt);
            }//endforeach
        }
Пример #4
0
        public bool FillCategoryTree(int parent, TreeNode tvUp, int open)
        {
            string queryCat;

            queryCat = "SELECT * FROM FILESCATEGORIES WHERE PARENTID = " + parent;
            DataSet dsC      = DatabaseConnection.CreateDataset(queryCat);
            bool    toExpand = false;

            foreach (DataRow dr in dsC.Tables[0].Rows)
            {
                TreeNode tv = new TreeNode();
                tv.Text     = "<a href=\"javascript:copyData('" + dr["Id"].ToString() + "', '" + dr["Description"].ToString() + "','CategoryTextSearch','CategoryIDSearch','Find')\" style=\"color:black;text-decoration:none\">" + dr["Description"].ToString() + "</a>";
                tv.NodeData = dr["Id"].ToString();
                if (!toExpand)
                {
                    toExpand = (open == Convert.ToInt32(dr["id"]));
                }
                tv.Expanded = FillCategoryTree(Convert.ToInt32(dr["Id"]), tv, open);                 // Chiamata ricorsiva per fare le foglie
                if (tv.Expanded)
                {
                    toExpand = true;
                }
                tv.ImageUrl         = "/webctrl_client/1_0/treeimages/folder.gif";
                tv.ExpandedImageUrl = "/webctrl_client/1_0/treeimages/folderopen.gif";

                tvUp.Nodes.Add(tv);
            }
            return(toExpand);
        }
Пример #5
0
        private Microsoft.Web.UI.WebControls.TreeNode GetNodePKCS7Document(PKCS7Document document, int documentIndex)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            node.NavigateUrl = DETAIL_PAGE + "?type=pk7mDocument&documentIndex=" + documentIndex.ToString();
            node.Target      = "right";
            node.Text        = String.Format("Documento firmato" /*, document.SignatureType.ToString()*/);;

            string imageUrl = FileManager.getFileIcon(this, "p7m");

            if (document.SignatureType == SignType.PADES)
            {
                imageUrl = FileManager.getFileIcon(this, "pdf");
            }

            node.ImageUrl         = imageUrl;
            node.SelectedImageUrl = imageUrl;

//			TreeNode folderNode=new TreeNode();
//			folderNode.Text="Altre informazioni";

            // Aggiunta nodi relativi alle firme digitali
            node.Nodes.Add(this.GetNodesFirmeDigitali(document.SignersInfo, documentIndex, null));

            // Aggiunta nodi relativi ai certificati
//			folderNode.Nodes.Add(this.GetNodesCertificati(document.SignersInfo,documentIndex));

            //node.Nodes.Add(node);

            return(node);
        }
Пример #6
0
        public void CreaTree(TreeView tree, int open)
        {
            string queryCat;

            queryCat = "SELECT * FROM FILESCATEGORIES WHERE PARENTID = 0";
            DataSet  dsC = DatabaseConnection.CreateDataset(queryCat);
            TreeNode tv1 = new TreeNode();

            tv1.Text = "<a href=\"javascript:copyData('', '','CategoryTextSearch','CategoryIdSearch','Find')\" style=\"color:black;text-decoration:none\">" + Root.rm.GetString("Dsttxt21") + "</a>";

            tree.Nodes.Add(tv1);
            foreach (DataRow dr in dsC.Tables[0].Rows)
            {
                TreeNode tv = new TreeNode();


                tv.Text = "<a href=\"javascript:copyData('" + dr["Id"].ToString() + "', '" + dr["Description"].ToString() + "','CategoryTextSearch','CategoryIdSearch','Find')\" style=\"color:black;text-decoration:none\">" + dr["Description"].ToString() + "</a>";

                tv.NodeData = dr["Id"].ToString();

                tv.Expanded         = FillCategoryTree(Convert.ToInt32(dr["Id"]), tv, open);         // Chiamata ricorsiva per fare le foglie
                tv.ImageUrl         = "/webctrl_client/1_0/treeimages/folder.gif";
                tv.ExpandedImageUrl = "/webctrl_client/1_0/treeimages/folderopen.gif";
                tree.Nodes.Add(tv);
            }
            tree.CssClass = "normal";
        }
Пример #7
0
        private void LoadToTree(Msft.TreeNode tn, FormulaSpace fs, string FullName)
        {
            tn.Text = fs.Name;
            foreach (FormulaSpace n in fs.Namespaces)
            {
                Msft.TreeNode t = new Msft.TreeNode();
                t.ImageUrl = Root() + "/Images/Namespace.bmp";
                tn.Nodes.Add(t);
                if (n.GroupOnly)
                {
                    LoadToTree(t, n, FullName);
                }
                else
                {
                    LoadToTree(t, n, FullName + "." + n.Name);
                }
            }
            foreach (FormulaProgram p in fs.Programs)
            {
                Msft.TreeNode t = new Msft.TreeNode();
                t.ImageUrl = Root() + "/Images/Program.bmp";

                t.NavigateUrl = "Explore.aspx?Id=" + Index++ + "&File=" + ddlFormulaFile.SelectedItem.Value;

                tn.Nodes.Add(t);
                LoadToTree(t, p, FullName + "." + p.Name);
            }
        }
Пример #8
0
    private void LoadSysCodeTree()
    {
        IList ilSysCodeType = SysCodeTypeSrv.GetAllSysCodeType();

        foreach (SysCodeType sct in ilSysCodeType)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            tvSysCodes.Nodes[0].Nodes.Add(node);
            node.Type    = "syscodetype";
            node.Text    = sct.Name;
            node.PKId    = sct.Id;
            node.OrderId = sct.OrderId.ToString();

            foreach (SysCode sc in sct.SysCodes)
            {
                Microsoft.Web.UI.WebControls.TreeNode node2 = new Microsoft.Web.UI.WebControls.TreeNode();
                node.Nodes.Add(node2);
                node2.Type    = "syscode";
                node2.Text    = sc.Name;
                node2.PKId    = sc.Id;
                node2.OrderId = sc.OrderId.ToString();
            }
        }

        tvSysCodes.Nodes[0].Expanded = true;
    }
Пример #9
0
        public static bool FillCategoryTree(int parent, TreeNode tvUp, int open, bool search, UserConfig uc)
        {
            string queryCat;

            queryCat = "SELECT * FROM CATALOGCATEGORIES WHERE PARENTID = " + parent;
            DataSet dsC      = DatabaseConnection.CreateDataset(queryCat);
            bool    toExpand = false;

            foreach (DataRow dr in dsC.Tables[0].Rows)
            {
                TreeNode tv = new TreeNode();
                if (search)
                {
                    tv.Text = "<a href=\"javascript:copyDataS('" + dr["Id"].ToString() + "', '" + dr["Description"].ToString() + "')\" style=\"color:black;text-decoration:none\">" + dr["Description"].ToString() + "</a>";
                }
                else
                {
                    tv.Text = "<a href=\"javascript:copyData('" + dr["Id"].ToString() + "', '" + dr["Description"].ToString() + "')\" style=\"color:black;text-decoration:none\">" + dr["Description"].ToString() + "</a>";
                }
                tv.NodeData = dr["Id"].ToString();
                if (!toExpand)
                {
                    toExpand = (open == Convert.ToInt32(dr["id"]));
                }
                tv.Expanded = FillCategoryTree(Convert.ToInt32(dr["Id"]), tv, open, search, uc);                 // Chiamata ricorsiva per fare le foglie
                if (tv.Expanded)
                {
                    toExpand = true;
                }
                tvUp.Nodes.Add(tv);
            }
            return(toExpand);
        }
Пример #10
0
    private void AddSubNodes(Microsoft.Web.UI.WebControls.TreeNode currentNode, ModuleType currentModuleType, Staff staff)
    {
        //增加子模块分类
        foreach (ModuleType mt in currentModuleType.SubModuleTypes)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "moduletype";
            node.Text = mt.Name;
            AddSubNodes(node, mt, staff);
            node.Expanded = true;
        }

        //增加模块
        foreach (Module m in currentModuleType.Modules)
        {
            if (staff.IsInnerUser == 1 ||
                ((m.Disabled == 0) && staff.HasGrantPermission(ModuleRightSrv.GetModuleRight(m, "rights_browse"))))
            {
                Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
                currentNode.Nodes.Add(node);
                node.Type   = "module";
                node.Text   = m.Name;
                node.Target = "modulePanel";
                if (m.ModuleUrl != null && m.ModuleUrl.Length > 0)
                {
                    node.NavigateUrl = m.ModuleUrl;
                }
                else
                {
                    node.NavigateUrl = "Welcome.aspx";
                }
            }
        }
    }
Пример #11
0
        /// <summary>
        /// Crea un Nodo per la Treeview
        /// </summary>
        /// <param name="text">Testo che si visualizza nella Treeview</param>
        /// <param name="type">Imposto il Tipo di nodo da creare(il tipo di nodo è definito nella funzione SetStyleTreeVieew)</param>
        /// <param name="values">uno o più parametri da passare in query string</param>
        /// <param name="setnav">Indica se true di impostare il Navige url del nodo</param>
        /// <param name="servizio">Indica se true che si tratta di un servizio false di una apparecchiatura</param>
        /// <returns></returns>
        ///
        private TreeNode Node(string text, string type, string values, bool setnav, bool servizio)
        {
            TreeNode n = new TreeNode();

            n.Type = type;
            n.Text = text;
            string nav = string.Empty;

            if (setnav == false)
            {
                n.NavigateUrl = "";
                n.Target      = "";
            }
            else
            {
                if (servizio == true)
                {
                    nav = "ServiceDettail.aspx?bl_id=" + values;
                }
                else
                {
                    nav = "SchedaApparecchiatura.aspx?eq_id=" + values;
                }
                n.NavigateUrl = nav;
                n.Target      = "doctrevew";
            }
            return(n);
        }        //Node
Пример #12
0
    private void Bind()
    {
        this.tv.Nodes.Clear();
        this.tv.Target = "Search_right";
        DataTable dataTable = new DataTable();

        if (this.drpbm.SelectedValue == "00")
        {
            dataTable = this.sia.GetClassID("a.CorpCode='" + this.drpbm.SelectedValue + "' and b.ClassTypeCode in(002,003)");
        }
        else
        {
            dataTable = this.sia.GetClassID("a.CorpCode='" + this.drpbm.SelectedValue + "' and b.ClassTypeCode='003'");
        }
        DataRow[] array = dataTable.Select("ParentClassCode=''", " ClassCode asc ");
        for (int i = 0; i < array.Length; i++)
        {
            Microsoft.Web.UI.WebControls.TreeNode treeNode = new Microsoft.Web.UI.WebControls.TreeNode();
            treeNode.Text        = array[i]["ClassName"].ToString();
            treeNode.NavigateUrl = "Search_right.aspx?cid=" + array[i]["ClassID"].ToString();
            treeNode.Target      = "rFrame";
            this.tv.Nodes.Add(treeNode);
            this.CreateChildNodes(treeNode, dataTable, "ParentClassCode='" + array[i]["ClassCode"].ToString() + "'");
        }
    }
Пример #13
0
    private void AddSubNodes(Microsoft.Web.UI.WebControls.TreeNode currentNode, RoleType currentRoleType)
    {
        //增加子角色分类
        foreach (RoleType rt in currentRoleType.SubRoleTypes)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "roletype";
            node.Text = rt.Name;
            node.PKId = rt.Id;
            node.OrderId = rt.OrderId.ToString();

            AddSubNodes(node, rt);

            node.Expanded = true;
        }

        //增加角色
        foreach (Role r in currentRoleType.Roles)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "role";
            node.Text = r.Name;
            node.PKId = r.Id;
            node.OrderId = r.OrderId.ToString();
        }
    }
Пример #14
0
 private void btn_rimuovi_Click(object sender, System.Web.UI.ImageClickEventArgs e)
 {
     try
     {
         bool            rootFolder     = false;
         string          nFasc          = "";
         DocsPaWR.Folder selectedFolder = getSelectedFolder(out rootFolder);
         if (rootFolder)
         {
             if (fascicolo.tipo.Equals("P"))
             {
                 Response.Write("<script>alert('Non è possibile rimuovere il fascicolo procedimentale: " + fascicolo.codice + "') ;</script>");
             }
             if (fascicolo.tipo.Equals("G"))
             {
                 Response.Write("<script>alert('Non è possibile rimuovere il fascicolo generale: " + fascicolo.codice + "') ;</script>");
             }
             return;
         }
         if (selectedFolder != null)
         {
             /* Se il folder selezionato ha figli (doc o sottocartelle) su cui HO visibilità
              * non deve essere rimosso. Dopo l'avviso all'utente, la procedura termina */
             if (selectedFolder.childs.Length > 0)
             {
                 Response.Write("<script>alert('Non è possibile rimuovere il sottofascicolo selezionato:\\n\\ncontiene DOCUMENTI o SOTTOFASCICOLI');</script>");
             }
             else
             {
                 /* Se il folder selezionato ha figli (doc o sottocartelle) su cui NON HO
                  * la visibilità non deve essere rimosso */
                 //CanRemoveFascicolo ritornerà un bool: true = posso rimuovere il folder, false altrimenti
                 if (!FascicoliManager.CanRemoveFascicolo(this, selectedFolder.systemID, out nFasc))
                 {
                     if (nFasc.Equals("0") || nFasc.Equals(""))
                     {
                         Response.Write("<script>alert('Non è possibile rimuovere il sottofascicolo selezionato:\\n\\ncontiene DOCUMENTI');</script>");
                     }
                     else
                     {
                         Response.Write("<script>alert('Non è possibile rimuovere il sottofascicolo selezionato:\\n\\ncontiene DOCUMENTI o SOTTOFASCICOLI');</script>");
                     }
                 }
                 else
                 {
                     Microsoft.Web.UI.WebControls.TreeNode parentNode = (Microsoft.Web.UI.WebControls.TreeNode)getSelectedNodeFolder().Parent;
                     FascicoliManager.delFolder(this, selectedFolder);
                     DocsPaWR.Folder folder = FascicoliManager.getFolder(this, fascicolo);
                     caricaFoldersFascicolo(folder);
                     DocsPaWR.Folder folderToSelect = (DocsPAWA.DocsPaWR.Folder)HashFolder[parentNode.ID];
                     selectNodeFolder(parentNode);
                 }
             }
         }
     }
     catch (System.Web.Services.Protocols.SoapException es)
     {
         ErrorManager.redirect(this, es);
     }
 }
Пример #15
0
 private void PopolaTreeview(DataSet Ds)
 {
     //imposto lo style alla treeview
     SetStyleTreeVieew();
     foreach (DataRow Dr in Ds.Tables[0].Rows)
     {
         TreeNode nox = new TreeNode();
         nox.Type     = "edificio";
         nox.Expanded = true;
         string descrizione = "";
         descrizione = Dr["DESCRIZIONE"].ToString();
         nox.Text    = descrizione;
         nox.Target  = Dr["ID"].ToString();
         TreeCtrl.Nodes.Add(nox);
         //Recupero i tutti i dati dell'edificio.
         DataRowCollection DrCollection = DatiEdificio(Int32.Parse(Dr["ID"].ToString()));
         //Ciclo per i servizi
         TreeNodeCollection nodePadre = null;
         foreach (DataRow DrDettagli in DrCollection)
         {
             nodePadre = AddNodesServizi(nox.Target, DrDettagli, NodeCollection());
         }
         //Fine Ciclo Servizi per edifio
     }
     //Fine Ciclo Edifici
 }
Пример #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetCacheability(HttpCacheability.NoCache);

        try
        {
            //当前角色。
            string roleId = Request.QueryString["id"];
            Role role = CommonSrv.LoadObjectById(typeof(Role), roleId) as Role;

            //权限。
            SysCodeType sct = SysCodeTypeSrv.GetSysCodeTypeByTag("rights");

            //生成树节点。
            IList topModuleTypes = ModuleTypeSrv.GetAllTopModuleType();
            foreach (ModuleType mt in topModuleTypes)
            {
                Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
                tvRights.Nodes.Add(node);
                node.Type = "moduletype";
                node.Text = mt.Name;

                AddSubNodes(node, mt, role, sct);

                node.Expanded = true;
            }
        }
        catch (Exception ex)
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "error", "<script type=\"text/javascript\">error=true;</script>");
            log.Error(null, ex);
        }
    }
Пример #17
0
        //�����ڵ�
        public void CreateNode(int parentid, Microsoft.Web.UI.WebControls.TreeNode parentnode, DataTable dt)
        {
            DataRow[] drs = dt.Select("ParentID= " + parentid);//ѡ�������ӽڵ�
            foreach (DataRow r in drs)
            {
                string ClassID = r["CategoryId"].ToString();
                string ClassDesc = r["Name"].ToString();
                string ParentId = r["ParentId"].ToString();
                //string Orders = r["Orders"].ToString();
                //string IsShow = r["IsShow"].ToString();

                    Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
                    node.Text = ClassDesc;
                    node.NodeData = ClassID;
                    //node.NavigateUrl = url;
                    //node.Target = TargetFrame;
                    //node.ImageUrl = imageurl;
                    node.Expanded=true;
                    int sonparentid = int.Parse(ClassID);// or =location

                    if (parentnode == null)
                    {
                        TreeView1.Nodes.Clear();
                        parentnode = new Microsoft.Web.UI.WebControls.TreeNode();
                        TreeView1.Nodes.Add(parentnode);
                    }
                    parentnode.Nodes.Add(node);
                    CreateNode( sonparentid, node, dt);

            }//endforeach
        }
Пример #18
0
    private void RemoveNeedlessModuleType(Microsoft.Web.UI.WebControls.TreeNode parentNode)
    {
        Microsoft.Web.UI.WebControls.TreeNodeCollection childNodes =
            (parentNode == null ? tvModules.Nodes : parentNode.Nodes);

        ArrayList tobeRemoved = new ArrayList();

        foreach (Microsoft.Web.UI.WebControls.TreeNode childNode in childNodes)
        {
            if (childNode.Type == "moduletype")
            {
                if (childNode.Nodes.Count > 0)
                {
                    RemoveNeedlessModuleType(childNode);
                }

                if (childNode.Nodes.Count == 0)
                {
                    tobeRemoved.Add(childNode);
                }
            }
        }
        foreach (object childNode in tobeRemoved)
        {
            (childNode as Microsoft.Web.UI.WebControls.TreeNode).Remove();
        }
    }
Пример #19
0
        private void selectNodeFolder(Microsoft.Web.UI.WebControls.TreeNode nodeFolderToSelect)
        {
            //TreeNode nodo=HashFolder[folderToSelect];
            //Folders.Nodes[folderToSelect]
            string idFolder = "";

            if (nodeFolderToSelect != null)
            {
                expandNode(nodeFolderToSelect);
                DocsPaWR.Folder folder = (DocsPAWA.DocsPaWR.Folder)HashFolder[Int32.Parse(nodeFolderToSelect.ID)];
                FascicoliManager.setFolderSelezionato(this, folder);
                if (folder != null)
                {
                    idFolder = nodeFolderToSelect.ID;
                }
                else
                {
                    idFolder = "";
                }
            }
            else
            {
                idFolder = "";
            }
        }
Пример #20
0
    private void AddSubNodes(Microsoft.Web.UI.WebControls.TreeNode currentNode, ModuleType currentModuleType)
    {
        //增加子模块分类
        foreach (ModuleType mt in currentModuleType.SubModuleTypes)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "moduletype";
            node.Text = mt.Name;
            node.PKId = mt.Id;
            node.OrderId = mt.OrderId.ToString();

            AddSubNodes(node, mt);

            node.Expanded = true;
        }

        //增加模块
        foreach (Module m in currentModuleType.Modules)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "module";
            node.Text = m.Name;
            node.PKId = m.Id;
            node.OrderId = m.OrderId.ToString();
        }
    }
Пример #21
0
    private void LoadModuleTree(Microsoft.Web.UI.WebControls.TreeNode currentNode, ModuleType currentModuleType)
    {
        IList subModuleType = null;
        if (currentModuleType != null)
            subModuleType = currentModuleType.SubModuleTypes;
        else
            subModuleType = ModuleTypeSrv.GetAllTopModuleType();

        //增加模块分类
        foreach (ModuleType mt in subModuleType)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "moduletype";
            node.Text = mt.Name;
            node.PKId = mt.Id;
            node.OrderId = mt.OrderId.ToString();

            LoadModuleTree(node, mt);

            node.Expanded = true;
        }

        currentNode.Expanded = true;
    }
Пример #22
0
    private void AddSubNodes(Microsoft.Web.UI.WebControls.TreeNode currentNode, ModuleType currentModuleType)
    {
        //增加子模块分类
        foreach (ModuleType mt in currentModuleType.SubModuleTypes)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type    = "moduletype";
            node.Text    = mt.Name;
            node.PKId    = mt.Id;
            node.OrderId = mt.OrderId.ToString();

            AddSubNodes(node, mt);

            node.Expanded = true;
        }

        //增加模块
        foreach (Module m in currentModuleType.Modules)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type    = "module";
            node.Text    = m.Name;
            node.PKId    = m.Id;
            node.OrderId = m.OrderId.ToString();
        }
    }
Пример #23
0
    private void AddSubNodes(Microsoft.Web.UI.WebControls.TreeNode currentNode, RoleType currentRoleType)
    {
        //增加子角色分类
        foreach (RoleType rt in currentRoleType.SubRoleTypes)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type    = "roletype";
            node.Text    = rt.Name;
            node.PKId    = rt.Id;
            node.OrderId = rt.OrderId.ToString();

            AddSubNodes(node, rt);

            node.Expanded = true;
        }

        //增加角色
        foreach (Role r in currentRoleType.Roles)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type    = "role";
            node.Text    = r.Name;
            node.PKId    = r.Id;
            node.OrderId = r.OrderId.ToString();
        }
    }
Пример #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetCacheability(HttpCacheability.NoCache);

        try
        {
            //当前职员。
            string staffId = Request.QueryString["id"];
            Staff  staff   = CommonSrv.LoadObjectById(typeof(Staff), staffId) as Staff;

            //权限。
            SysCodeType sct = SysCodeTypeSrv.GetSysCodeTypeByTag("rights");

            //生成树节点。
            IList topModuleTypes = ModuleTypeSrv.GetAllTopModuleType();
            foreach (ModuleType mt in topModuleTypes)
            {
                Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
                tvRights.Nodes.Add(node);
                node.Type = "moduletype";
                node.Text = mt.Name;

                AddSubNodes(node, mt, staff, sct);

                node.Expanded = true;
            }
        }
        catch (Exception ex)
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "error", "<script type=\"text/javascript\">error=true;</script>");
            log.Error(null, ex);
        }
    }
Пример #25
0
        //�����ڵ�
        public void CreateNode(int parentid, Microsoft.Web.UI.WebControls.TreeNode parentnode, DataTable dt)
        {
            DataRow[] drs = dt.Select("ParentID= " + parentid);//ѡ�������ӽڵ�
            foreach (DataRow r in drs)
            {
                string nodeid = r["NodeID"].ToString();
                string text = r["Text"].ToString();
                string location = r["Location"].ToString();
                string url = r["Url"].ToString();
                string imageurl = r["ImageUrl"].ToString();
                int permissionid = int.Parse(r["PermissionID"].ToString().Trim());

                Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
                node.Text = text + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"modify.aspx?id=" + nodeid + "\">�޸�</a> " +
                    "&nbsp;&nbsp;&nbsp;&nbsp;<a onClick=\"if (!window.confirm('�����Ҫɾ��������¼��')){return false;}\" href=\"delete.aspx?id=" + nodeid + "\">ɾ��</a>" +
                    "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"add.aspx?nodeid="+nodeid+"\">���ӽڵ�</a>";
                node.NodeData = nodeid;
                //node.NavigateUrl = url;
                //node.Target = TargetFrame;
                node.ImageUrl = "../" + imageurl;
                node.Expanded = false;
                int sonparentid = int.Parse(nodeid);// or =location

                if (parentnode == null)
                {
                    TreeView1.Nodes.Clear();
                    parentnode = new Microsoft.Web.UI.WebControls.TreeNode();
                    TreeView1.Nodes.Add(parentnode);
                }
                parentnode.Nodes.Add(node);
                CreateNode(sonparentid, node, dt);

            }//endforeach
        }
Пример #26
0
        private void CaricaDatiRicerca(string idFascicolo, string idFolderSel)
        {
            ClearTreeView();
            fascicoloSelezionato = FascicoliManager.getFascicoloById(this, idFascicolo);
            FascicoliManager.setFascicoloSelezionato(this, fascicoloSelezionato);
            Folder folder = FascicoliManager.getFolder(this, fascicoloSelezionato.systemID, "");

            Microsoft.Web.UI.WebControls.TreeNode rootFolder = new Microsoft.Web.UI.WebControls.TreeNode();
            //Creo la root folder dell'albero
            rootFolder.Text = fascicoloSelezionato.codice;
            rootFolder.ID   = fascicoloSelezionato.systemID;

            if (folder.childs.Length > 0)
            {
                LoadTreeview(rootFolder, folder, idFolderSel);
            }

            Folders.Nodes.Add(rootFolder);

            Microsoft.Web.UI.WebControls.TreeNode nodoSel = getSelectedNodeFolder();
            if (nodoSel != null)
            {
                Folders.SelectedNodeIndex = nodoSel.GetNodeIndex();
            }
        }
Пример #27
0
        private void LoadTreeview(Microsoft.Web.UI.WebControls.TreeNode myTreeNodo, DocsPaWR.Folder folder, string idFolderSel)
        {
            //if (folder.descrizione.ToLower() != myTreeNodo.Text)
            if (folder.descrizione.ToLower() != "root folder" && folder.descrizione.ToLower() != myTreeNodo.Text)
            {
                Microsoft.Web.UI.WebControls.TreeNode newAddedNode = addFolderNode(myTreeNodo, folder);

                if (folder.systemID == idFolderSel)
                {
                    this.ExpandAllParentNodes(newAddedNode);
                    this.Page.Session["RicercaSottoFascicoli.nodoSelezionato"] = newAddedNode;
                }

                myTreeNodo = newAddedNode;
            }
            int g = folder.childs.Length;

            for (int j = 0; j < g; j++)
            {
                DocsPaWR.Folder newFolder = folder.childs[j];

                //richiama la funzione ricorsivamente
                LoadTreeview(myTreeNodo, newFolder, idFolderSel);
            }
        }
Пример #28
0
        //邦定任意节点
        public void CreateNode(int parentid, Microsoft.Web.UI.WebControls.TreeNode parentnode, DataTable dt)
        {
            DataRow[] drs = dt.Select("ParentID= " + parentid);//选出所有子节点
            foreach (DataRow r in drs)
            {
                string nodeid       = r["NodeID"].ToString();
                string text         = r["Text"].ToString();
                string location     = r["Location"].ToString();
                string url          = r["Url"].ToString();
                string imageurl     = r["ImageUrl"].ToString();
                int    permissionid = int.Parse(r["PermissionID"].ToString().Trim());


                Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
                node.Text = text + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"modify.aspx?id=" + nodeid + "\">修改</a> " +
                            "&nbsp;&nbsp;&nbsp;&nbsp;<a onClick=\"if (!window.confirm('您真的要删除这条记录吗?')){return false;}\" href=\"delete.aspx?id=" + nodeid + "\">删除</a>" +
                            "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"add.aspx?nodeid=" + nodeid + "\">增加节点</a>";
                node.NodeData = nodeid;
                //node.NavigateUrl = url;
                //node.Target = TargetFrame;
                node.ImageUrl = "../" + imageurl;
                node.Expanded = false;
                int sonparentid = int.Parse(nodeid);// or =location

                if (parentnode == null)
                {
                    TreeView1.Nodes.Clear();
                    parentnode = new Microsoft.Web.UI.WebControls.TreeNode();
                    TreeView1.Nodes.Add(parentnode);
                }
                parentnode.Nodes.Add(node);
                CreateNode(sonparentid, node, dt);
            }//endforeach
        }
Пример #29
0
            private System.Windows.Forms.TreeNode Add(System.Windows.Forms.TreeNode parent)
            {
                string strText = "Node" + NextNode++.ToString();

                System.Windows.Forms.TreeNode newnode;
                Microsoft.Web.UI.WebControls.TreeNodeCollection col;
                Microsoft.Web.UI.WebControls.TreeNode           webNode;

                if (parent == null)
                {
                    newnode = tvNodes.Nodes.Add(strText);
                    col     = tvWebNodes.Nodes;
                }
                else
                {
                    newnode = parent.Nodes.Add(strText);
                    parent.Expand();
                    col = ((Microsoft.Web.UI.WebControls.TreeNode)parent.Tag).Nodes;
                }

                webNode      = new Microsoft.Web.UI.WebControls.TreeNode();
                webNode.Text = strText;
                col.Add(webNode);
                newnode.Tag = webNode;

                btnApply.Enabled = true;

                return(newnode);
            }
Пример #30
0
    private void LoadDepartmentTree(Microsoft.Web.UI.WebControls.TreeNode currentNode, Department currentDepartment)
    {
        IList subDepartments = null;

        if (currentDepartment != null)
        {
            subDepartments = currentDepartment.SubDepartments;
        }
        else
        {
            subDepartments = DepartmentSrv.GetAllTopDepartment();
        }

        foreach (Department d in subDepartments)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type    = "department";
            node.Text    = d.Name;
            node.PKId    = d.Id;
            node.OrderId = d.OrderId.ToString();

            LoadDepartmentTree(node, d);

            node.Expanded = true;
        }

        currentNode.Expanded = true;
    }
Пример #31
0
    private void LoadSysCodeTree()
    {
        IList ilSysCodeType = SysCodeTypeSrv.GetAllSysCodeType();

        foreach (SysCodeType sct in ilSysCodeType)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            tvSysCodes.Nodes[0].Nodes.Add(node);
            node.Type = "syscodetype";
            node.Text = sct.Name;
            node.PKId = sct.Id;
            node.OrderId = sct.OrderId.ToString();

            foreach (SysCode sc in sct.SysCodes)
            {
                Microsoft.Web.UI.WebControls.TreeNode node2 = new Microsoft.Web.UI.WebControls.TreeNode();
                node.Nodes.Add(node2);
                node2.Type = "syscode";
                node2.Text = sc.Name;
                node2.PKId = sc.Id;
                node2.OrderId = sc.OrderId.ToString();
            }
        }

        tvSysCodes.Nodes[0].Expanded = true;
    }
Пример #32
0
    private void AddSubNodes(Microsoft.Web.UI.WebControls.TreeNode currentNode, RoleType currentRoleType, Staff s)
    {
        //增加子角色分类
        foreach (RoleType rt in currentRoleType.SubRoleTypes)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "roletype";
            node.Text = rt.Name;
            node.PKId = rt.Id;

            AddSubNodes(node, rt, s);

            node.Expanded = true;
        }

        //增加角色
        foreach (Role r in currentRoleType.Roles)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "role";
            node.Text = r.Name;
            node.PKId = r.Id;
            node.CheckBox = true;
            node.Checked = s.Roles.Contains(r);
        }
    }
Пример #33
0
    private void LoadRoleTree(Microsoft.Web.UI.WebControls.TreeNode currentNode, RoleType currentRoleType)
    {
        IList subRoleType = null;
        if (currentRoleType != null)
            subRoleType = currentRoleType.SubRoleTypes;
        else
            subRoleType = RoleTypeSrv.GetAllTopRoleType();

        //增加角色分类。
        foreach (RoleType rt in subRoleType)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "roletype";
            node.Text = rt.Name;
            node.PKId = rt.Id;
            node.OrderId = rt.OrderId.ToString();

            LoadRoleTree(node, rt);

            node.Expanded = true;
        }

        currentNode.Expanded = true;
    }
Пример #34
0
    private void LoadRoleTree(Microsoft.Web.UI.WebControls.TreeNode currentNode, RoleType currentRoleType)
    {
        IList subRoleType = null;

        if (currentRoleType != null)
        {
            subRoleType = currentRoleType.SubRoleTypes;
        }
        else
        {
            subRoleType = RoleTypeSrv.GetAllTopRoleType();
        }

        //增加角色分类。
        foreach (RoleType rt in subRoleType)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type    = "roletype";
            node.Text    = rt.Name;
            node.PKId    = rt.Id;
            node.OrderId = rt.OrderId.ToString();

            LoadRoleTree(node, rt);

            node.Expanded = true;
        }

        currentNode.Expanded = true;
    }
Пример #35
0
    private void AddSubNodes(Microsoft.Web.UI.WebControls.TreeNode currentNode, RoleType currentRoleType, Staff s)
    {
        //增加子角色分类
        foreach (RoleType rt in currentRoleType.SubRoleTypes)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "roletype";
            node.Text = rt.Name;
            node.PKId = rt.Id;

            AddSubNodes(node, rt, s);

            node.Expanded = true;
        }

        //增加角色
        foreach (Role r in currentRoleType.Roles)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type     = "role";
            node.Text     = r.Name;
            node.PKId     = r.Id;
            node.CheckBox = true;
            node.Checked  = s.Roles.Contains(r);
        }
    }
Пример #36
0
        public void CreaTree(TreeView tree, int open)
        {
            string queryCat;

            queryCat = "SELECT * FROM CatalogCategories WHERE ParentID = 0";
            DataSet dsC = DatabaseConnection.CreateDataset(queryCat);

            foreach (DataRow dr in dsC.Tables[0].Rows)
            {
                TreeNode tv  = new TreeNode();
                string   del = "0";
                if (Convert.ToInt32(DatabaseConnection.SqlScalar("SELECT COUNT(*) FROM CATALOGCATEGORIES WHERE PARENTID=" + dr["Id"].ToString())) > 0)
                {
                    del = "1";
                }

                else if (Convert.ToInt32(DatabaseConnection.SqlScalar("SELECT COUNT(*) FROM CATALOGPRODUCTS WHERE CATEGORY=" + dr["Id"].ToString())) > 0)
                {
                    del = "1";
                }


                tv.Text     = "<a href=\"javascript:copyData('" + dr["Id"].ToString() + "','" + dr["Description"].ToString() + "','" + dr["ParentID"].ToString() + "'," + del + ",'" + ((dr["EMAILOWNER"] != DBNull.Value)?dr["EMAILOWNER"].ToString():string.Empty) + "')\" style=\"color:black;text-decoration:none\">" + dr["Description"].ToString() + "</a>";
                tv.NodeData = dr["Id"].ToString();

                tv.Expanded = FillCategoryTree(Convert.ToInt32(dr["Id"]), tv, open);                 // Chiamata ricorsiva per fare le foglie

                tree.Nodes.Add(tv);
            }
            tree.CssClass = "normal";
        }
Пример #37
0
        private void BindDeptsType(EntitiesNoName ens, int len)
        {
            foreach (EntityNoName en in ens)
            {
                if (en.No.Length != len)
                {
                    continue;
                }


                Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode();
                tn.Text = en.Name;
                tn.ID   = "TN" + en.No;
                if (len == 2)
                {
                    this.Nodes.Add(tn);
                }


                Microsoft.Web.UI.WebControls.TreeNode ptn = this.GetNodeByID("TN" + en.No.Substring(0, en.No.Length - 2));
                if (ptn != null)
                {
                    ptn.Nodes.Add(tn);
                }
                else
                {
                    this.Nodes.Add(tn);
                }
            }
        }
Пример #38
0
        /// <summary>
        /// treeViewUO_Collapse
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeViewUO_Collapse(object sender, Microsoft.Web.UI.WebControls.TreeViewClickEventArgs e)
        {
            try
            {
                if (e.Node != "0")
                {
                    myTreeNode TreeNodo;
                    TreeNodo = (myTreeNode)treeViewUO.GetNodeFromIndex(e.Node);

                    Microsoft.Web.UI.WebControls.TreeNode nodoFiglio;

                    if (TreeNodo.getTipoNodo().Equals("U"))
                    {
                        if (TreeNodo.Nodes.Count > 0)
                        {
                            TreeNodo.Nodes.Clear();
                        }

                        nodoFiglio      = new Microsoft.Web.UI.WebControls.TreeNode();
                        nodoFiglio.Text = "<font color='#ff0000'>&nbsp;loading...</font>";
                        TreeNodo.Nodes.Add(nodoFiglio);
                    }

                    if (this.GetReadOnly())
                    {
                        treeViewUO.SelectedNodeIndex = e.Node;
                    }
                }
            }
            catch
            {
                this.executeJS("<SCRIPT>alert('Attenzione, si è verificato un errore di sistema');</SCRIPT>");
            }
        }
Пример #39
0
    private void LoadModuleTree(Microsoft.Web.UI.WebControls.TreeNode currentNode, ModuleType currentModuleType)
    {
        IList subModuleType = null;

        if (currentModuleType != null)
        {
            subModuleType = currentModuleType.SubModuleTypes;
        }
        else
        {
            subModuleType = ModuleTypeSrv.GetAllTopModuleType();
        }

        //增加模块分类
        foreach (ModuleType mt in subModuleType)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type    = "moduletype";
            node.Text    = mt.Name;
            node.PKId    = mt.Id;
            node.OrderId = mt.OrderId.ToString();

            LoadModuleTree(node, mt);

            node.Expanded = true;
        }

        currentNode.Expanded = true;
    }
Пример #40
0
    private void AddSubNodes(Microsoft.Web.UI.WebControls.TreeNode currentNode, ModuleType currentModuleType, Staff staff)
    {
        //增加子模块分类
        foreach (ModuleType mt in currentModuleType.SubModuleTypes)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "moduletype";
            node.Text = mt.Name;
            AddSubNodes(node, mt, staff);
            node.Expanded = true;
        }

        //增加模块
        foreach (Module m in currentModuleType.Modules)
        {
            if (staff.IsInnerUser == 1 ||
                ((m.Disabled == 0) && staff.HasGrantPermission(ModuleRightSrv.GetModuleRight(m, "rights_browse"))))
            {
                Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
                currentNode.Nodes.Add(node);
                node.Type = "module";
                node.Text = m.Name;
                node.Target = "modulePanel";
                if(m.ModuleUrl != null && m.ModuleUrl.Length > 0)
                {
                    node.NavigateUrl = m.ModuleUrl;
                }
                else
                {
                    node.NavigateUrl = "Welcome.aspx";
                }
            }
        }
    }
Пример #41
0
    private void AddSubNodes(Microsoft.Web.UI.WebControls.TreeNode currentNode, ModuleType currentModuleType, Role role, SysCodeType sct)
    {
        //增加子模块分类
        foreach (ModuleType mt in currentModuleType.SubModuleTypes)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "moduletype";
            node.Text = mt.Name;

            AddSubNodes(node, mt, role, sct);

            node.Expanded = true;
        }

        //增加模块
        foreach (Module m in currentModuleType.Modules)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "module";
            node.Text = m.Name;

            //增加肯定权限。
            foreach (SysCode sc in sct.SysCodes)
            {
                if (m.ModuleRights.Contains(sc.Tag))
                {
                    ModuleRight mr = m.ModuleRights[sc.Tag] as ModuleRight;
                    Microsoft.Web.UI.WebControls.TreeNode rightsNode = new Microsoft.Web.UI.WebControls.TreeNode();
                    node.Nodes.Add(rightsNode);
                    rightsNode.Type = "grant";
                    rightsNode.Text = sc.Name;
                    rightsNode.PKId = mr.Id;
                    rightsNode.CheckBox = true;
                    rightsNode.Checked = role.ModuleRightsGrant.Contains(mr);
                }
            }

            //增加否定权限。
            foreach (SysCode sc in sct.SysCodes)
            {
                if (m.ModuleRights.Contains(sc.Tag))
                {
                    ModuleRight mr = m.ModuleRights[sc.Tag] as ModuleRight;
                    Microsoft.Web.UI.WebControls.TreeNode rightsNode = new Microsoft.Web.UI.WebControls.TreeNode();
                    node.Nodes.Add(rightsNode);
                    rightsNode.Type = "deny";
                    rightsNode.Text = sc.Name;
                    rightsNode.PKId = mr.Id;
                    rightsNode.CheckBox = true;
                    rightsNode.Checked = role.ModuleRightsDeny.Contains(mr);
                }
            }
        }
    }
Пример #42
0
    private void LoadDepartmentTree(Microsoft.Web.UI.WebControls.TreeNode currentNode, Department currentDepartment)
    {
        IList subDepartments = null;
        if (currentDepartment != null)
            subDepartments = currentDepartment.SubDepartments;
        else
            subDepartments = DepartmentSrv.GetAllTopDepartment();

        //增加子部门。
        foreach (Department d in subDepartments)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "department";
            node.Text = d.Name;
            node.PKId = d.Id;
            node.OrderId = d.OrderId.ToString();

            LoadDepartmentTree(node, d);

            node.Expanded = true;
        }

        //增加职员。
        if (currentDepartment != null)
        {
            foreach (Staff s in currentDepartment.Staff)
            {
                if (s.IsInnerUser == 0)
                {
                    Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
                    currentNode.Nodes.Add(node);
                    node.Text = s.Name;
                    node.PKId = s.LoginId;
                    node.OrderId = s.OrderId.ToString();
                    if (s.Disabled == 1)
                        node.Type = "staffdisabled";
                    else
                        node.Type = "staff";
                }
            }
        }

        currentNode.Expanded = true;
    }
Пример #43
0
        //����ڵ�
        public void BindTreeView(string TargetFrame,DataTable dt)
        {
            DataRow [] drs = dt.Select("ParentID= " + 0);//��ѡ�������ӽڵ�

            //�˵�״̬
            string MenuExpanded=ConfigurationManager.AppSettings.Get("MenuExpanded");
            bool menuExpand=bool.Parse(MenuExpanded);

            TreeView1.Nodes.Clear(); // �����
            foreach( DataRow r in drs )
            {
                string nodeid=r["NodeID"].ToString();
                string text=r["Text"].ToString();
                string parentid=r["ParentID"].ToString();
                string location=r["Location"].ToString();
                string url=r["Url"].ToString();
                string imageurl=r["ImageUrl"].ToString();
                int permissionid=int.Parse(r["PermissionID"].ToString().Trim());
                string framename=TargetFrame;

                //treeview set
                this.TreeView1.Font.Name="����";
                this.TreeView1.Font.Size=FontUnit.Parse("9");

                //Ȩ�޿��Ʋ˵�
                if((permissionid==-1)||(user.HasPermissionID(permissionid)))//���û���Ȩ�޵ĺ�û��Ȩ�޵ģ��������IJ˵���
                {
                    Microsoft.Web.UI.WebControls.TreeNode rootnode = new Microsoft.Web.UI.WebControls.TreeNode();
                    rootnode.Text=text;
                    rootnode.NodeData=nodeid;
                    rootnode.NavigateUrl=url;
                    rootnode.Target=framename;
                    rootnode.Expanded=menuExpand;
                    rootnode.ImageUrl=imageurl;

                    TreeView1.Nodes.Add(rootnode);

                    int sonparentid=int.Parse(nodeid);// or =location
                    CreateNode(framename,sonparentid,rootnode,dt);
                }

            }
        }
Пример #44
0
        //邦定根节点
        public void BindTreeView()
        {
            Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category();
            DataTable dt = bll.GetAllList().Tables[0];
            DataRow[] drs = dt.Select("ParentID= " + 0);// 选出所有子节点	

            //菜单状态           
            bool menuExpand = true;

            TreeView1.Nodes.Clear(); // 清空树
            foreach (DataRow r in drs)
            {
                string ClassID = r["CategoryId"].ToString();
                string ClassDesc = "<b>" + r["Name"].ToString() + "</b>";
                string ParentId = r["ParentId"].ToString();
                //string Orders = r["Orders"].ToString();
                //string IsShow = r["IsShow"].ToString();

                //if (IsShow == "false")
                //{
                //    ClassDesc = "";
                //}

                //treeview set
                this.TreeView1.Font.Name = "宋体";
                this.TreeView1.Font.Size = FontUnit.Parse("9");

                Microsoft.Web.UI.WebControls.TreeNode rootnode = new Microsoft.Web.UI.WebControls.TreeNode();
                rootnode.Text = ClassDesc;
                rootnode.NodeData = ClassID;
                //rootnode.NavigateUrl = url;
                //rootnode.Target = framename;
                rootnode.Expanded = menuExpand;
                //rootnode.ImageUrl = imageurl;

                TreeView1.Nodes.Add(rootnode);

                int sonparentid = int.Parse(ClassID);// or =location
                CreateNode(sonparentid, rootnode, dt);
                
            }

        }
Пример #45
0
    private void LoadRoleTree(Staff s)
    {
        IList ilRoleType = RoleTypeSrv.GetAllTopRoleType();

        //增加角色分类
        foreach (RoleType rt in ilRoleType)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            tvRoles.Nodes.Add(node);
            node.Type = "roletype";
            node.Text = rt.Name;
            node.PKId = rt.Id;

            AddSubNodes(node, rt, s);

            node.Expanded = true;
        }

        tvRoles.Nodes[0].Expanded = true;
    }
Пример #46
0
        //邦定根节点
        public void BindTreeView()
        {
            Maticsoft.BLL.SysManage bll = new Maticsoft.BLL.SysManage();
            DataTable dt = bll.GetTreeList("").Tables[0];
            DataRow[] drs = dt.Select("ParentID= " + 0);//选出所有子节点	

            //菜单状态           
            bool menuExpand = false;
            TreeView1.Nodes.Clear(); // 清空树
            foreach (DataRow r in drs)
            {
                string nodeid = r["NodeID"].ToString();
                string text = r["Text"].ToString();
                string parentid = r["ParentID"].ToString();
                string location = r["Location"].ToString();
                string url = r["Url"].ToString();
                string imageurl = r["ImageUrl"].ToString();
                int permissionid = int.Parse(r["PermissionID"].ToString().Trim());

                //treeview set
                this.TreeView1.Font.Name = "宋体";
                this.TreeView1.Font.Size = FontUnit.Parse("9");

                Microsoft.Web.UI.WebControls.TreeNode rootnode = new Microsoft.Web.UI.WebControls.TreeNode();
                rootnode.Text = text + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"modify.aspx?id=" + nodeid + "\">修改</a> "+
                    "&nbsp;&nbsp;&nbsp;&nbsp;<a onClick=\"if (!window.confirm('您真的要删除这条记录吗?')){return false;}\" href=\"delete.aspx?id=" + nodeid + "\">删除</a>"+
                    "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"add.aspx?nodeid=" + nodeid + "\">增加节点</a>";
                rootnode.NodeData = nodeid;
                //rootnode.NavigateUrl = url;
                //rootnode.Target = framename;
                rootnode.Expanded = menuExpand;
                rootnode.ImageUrl = "../" + imageurl;

                TreeView1.Nodes.Add(rootnode);

                int sonparentid = int.Parse(nodeid);// or =location
                CreateNode(sonparentid, rootnode, dt);

            }

        }
Пример #47
0
    private void LoadDepartmentTree(Microsoft.Web.UI.WebControls.TreeNode currentNode, Department currentDepartment)
    {
        IList subDepartments = null;
        if (currentDepartment != null)
            subDepartments = currentDepartment.SubDepartments;
        else
            subDepartments = DepartmentSrv.GetAllTopDepartment();

        foreach (Department d in subDepartments)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "department";
            node.Text = d.Name;
            node.PKId = d.Id;
            node.OrderId = d.OrderId.ToString();

            LoadDepartmentTree(node, d);

            node.Expanded = true;
        }

        currentNode.Expanded = true;
    }
Пример #48
0
        //����ڵ�
        public void BindTreeView2(string TargetFrame,DataTable dt)
        {
            string nodeid=dt.Rows[0]["NodeID"].ToString();
            string text=dt.Rows[0]["Text"].ToString();
            string parentid=dt.Rows[0]["ParentID"].ToString();
            string location=dt.Rows[0]["Location"].ToString();
            string url=dt.Rows[0]["Url"].ToString();
            string imageurl=dt.Rows[0]["ImageUrl"].ToString();
            string permissionid=dt.Rows[0]["PermissionID"].ToString();
            string framename=TargetFrame;

            int i=this.TreeView1.Nodes.Count;

            TreeView1.Nodes.Clear(); // �����
            Microsoft.Web.UI.WebControls.TreeNode rootnode = new Microsoft.Web.UI.WebControls.TreeNode();
            rootnode.Text=text;
            rootnode.NodeData=nodeid;
            rootnode.NavigateUrl=url;
            rootnode.Target=framename;
            rootnode.Expanded=true;
            rootnode.ImageUrl=imageurl;

            //			rootnode.ExpandedImageUrl="open.gif";
            //			rootnode.SelectedImageUrl="close.gif";
            TreeView1.Nodes.Add(rootnode);

            //treeview set
            this.TreeView1.ShowLines=false;
            this.TreeView1.ShowPlus=true;//�Ƿ���ʾǰ��ļӼ���

            string sonparentid=parentid+nodeid+"_";// or =location

            CreateNode2(framename,sonparentid,rootnode,dt);
        }
Пример #49
0
        //�����ڵ�
        public void CreateNode2(string TargetFrame, string parentid, Microsoft.Web.UI.WebControls.TreeNode parentnode, DataTable dt)
        {
            DataRow [] drs = dt.Select("ParentID" +"= '" + parentid + "'");//��ѡ�������ӽڵ�
            foreach( DataRow r in drs )
            {
                string nodeid=r["NodeID"].ToString();
                string text=r["Text"].ToString();
                //				string parentid=r["ParentID"].ToString();
                string location=r["Location"].ToString();
                string url=r["Url"].ToString();
                string imageurl=r["ImageUrl"].ToString();
                string permissionid=r["PermissionID"].ToString();
                string framename=TargetFrame;

                Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
                node.Text = text;
                node.NodeData = nodeid;
                node.NavigateUrl=url;
                node.Target=TargetFrame;
                node.ImageUrl=imageurl;
                node.Expanded=true;

                string sonparentid=parentid+nodeid+"_";// or =location

                //				if((permissionid==null)||(permissionid==-1))
                //				{
                //					DataRow [] drst = dt.Select("ParentID" +"= '" + sonparentid + "'");//��ѡ�������ӽڵ�
                //					//if(drst.Length
                //
                //				}
                //
                parentnode.Nodes.Add(node);

                CreateNode2(framename,sonparentid,node,dt);

            }
        }
Пример #50
0
        //�����ڵ�
        public void CreateNode(string TargetFrame, int parentid, Microsoft.Web.UI.WebControls.TreeNode parentnode, DataTable dt)
        {
            DataRow [] drs = dt.Select("ParentID= " + parentid );//ѡ�������ӽڵ�
            foreach( DataRow r in drs )
            {
                string nodeid=r["NodeID"].ToString();
                string text=r["Text"].ToString();
                string location=r["Location"].ToString();
                string url=r["Url"].ToString();
                string imageurl=r["ImageUrl"].ToString();
                int permissionid=int.Parse(r["PermissionID"].ToString().Trim());
                string framename=TargetFrame;

                //Ȩ�޿��Ʋ˵�
                if((permissionid==-1)||(user.HasPermissionID(permissionid)))
                {

                    Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
                    node.Text = text;
                    node.NodeData = nodeid;
                    node.NavigateUrl=url;
                    node.Target=TargetFrame;
                    node.ImageUrl=imageurl;
                    //node.Expanded=true;
                    int sonparentid=int.Parse(nodeid);// or =location

                    if(parentnode==null)
                    {
                        TreeView1.Nodes.Clear();
                        parentnode = new Microsoft.Web.UI.WebControls.TreeNode();
                        TreeView1.Nodes.Add(parentnode);
                    }
                    parentnode.Nodes.Add(node);
                    CreateNode(framename,sonparentid,node,dt);
                }//endif

            }//endforeach
        }
Пример #51
0
        /// <summary>
        /// ��ʼ��TreeView �� RootNode
        /// </summary>
        private void InitTreeRootNode(Microsoft.Web.UI.WebControls.TreeNodeCollection TNC)
        {
            DataView dataView = new DataView();
            dataView = dataTbl1.Copy().DefaultView;
            dataView.RowFilter = "Super_Position_ID = Position_ID";
            foreach (DataRowView drv in dataView)
            {
                Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode();
                tn.ID = drv["Position_ID"].ToString();
                tn.Text = "<span onmouseover=javascript:title='" + drv["Position_Description"].ToString() + "'>" + drv["Position_Name"].ToString() + "</span>";
                tn.ImageUrl = GetIcon("8");
                tn.NavigateUrl = "ListView.aspx?PositionID=" + tn.ID;
                tn.Target = "MainFrame";
                TNC.Add(tn);
                InitChildNodeDataTable(Int32.Parse(tn.ID.ToString()));
                InitTreeChildNode(tn.Nodes, tn.ID);
            }

            dataTbl1 = null;
            dataTbl2 = null;
        }
Пример #52
0
        private void GetRoleNode(Microsoft.Web.UI.WebControls.TreeNode tv)
        {
            TreeView1.ShowToolTip = true;
            Database db = new Database();
            SqlDataReader dr = null;
            try
            {
                db.RunProc("sp_GetRole", out dr);
                while (dr.Read())
                {
                    Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode();
                    tn.ID = dr["Role_ID"].ToString();
                    tn.Text = "<span onmouseover=javascript:title='" + dr["Role_Description"].ToString() + "'>" + dr["Role_Name"].ToString() + "</span>";
                    tn.ImageUrl = GetIcon("9");
                    tn.NavigateUrl = "ListView.aspx?Role_ID=" + dr["Role_ID"].ToString();
                    tn.Target = "MainFrame";
                    tv.Nodes.Add(tn);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
                UDS.Components.Error.Log(ex.ToString());
            }
            finally
            {
                if (db != null)
                { db.Close(); }
                if (dr != null)
                {

                    dr.Close();
                }

            }
        }
Пример #53
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode();
         tn.Text = "<span onmouseover=javascript:title='�ҵĽ�ɫ'>�ҵĽ�ɫ</span>";
         tn.ImageUrl = GetIcon("9");
         TreeView1.Nodes.Add(tn);
         GetRoleNode(tn);
         TreeView1.Nodes[0].Expanded = true;
     }
 }
 /// <summary>
 /// ��ʼ��TreeView �� ChildNode
 /// </summary>
 private void InitTreeChildNode(Microsoft.Web.UI.WebControls.TreeNodeCollection TNC, string classParentID)
 {
     DataView dataView  = new DataView();
     dataView		   = dataTbl2.Copy().DefaultView ;
     dataView.RowFilter = "ClassParentID = " + classParentID + "";
     foreach(DataRowView drv in dataView)
     {
         Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode();
         tn.ID		   = drv["ClassID"].ToString();
         tn.Text		   = drv["ClassName"].ToString();
         tn.ImageUrl    = GetIcon(drv["ClassType"].ToString(),_imagepath);
         //tn.NavigateUrl = "#";
         //tn.Target      = "parent";
         TNC.Add(tn);
         InitTreeChildNode(tn.Nodes,tn.ID);
     }
 }
 /// <summary>
 /// ��ʼ��TreeView �� RootNode
 /// </summary>
 private void InitTreeRootNode(Microsoft.Web.UI.WebControls.TreeNodeCollection TNC)
 {
     DataView dataView  = new DataView();
     dataView		   = dataTbl1.Copy().DefaultView;
     dataView.RowFilter = "ClassParentID = ClassID";
     foreach(DataRowView drv in dataView)
     {
         Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode();
         tn.ID		   = drv["ClassID"].ToString();
         tn.Text		   = drv["ClassName"].ToString();
         tn.ImageUrl    = GetIcon(drv["ClassType"].ToString(),_imagepath);
         //tn.NavigateUrl = "# onclick='alert('dddd')'";
         //tn.Target      = "self";
         TNC.Add(tn);
         InitChildNodeDataTable(Int32.Parse(tn.ID.ToString()));
         InitTreeChildNode(tn.Nodes,tn.ID);
     }
     dataTbl1 = null;
     dataTbl2 = null;
 }
Пример #56
0
        /// <summary>
        /// ��ʼ��TreeView �� RootNode
        /// </summary>
        private void InitTreeRootNode(Microsoft.Web.UI.WebControls.TreeNodeCollection TNC)
        {
            DataView dataView  = new DataView();
            dataView		   = dataTbl1.Copy().DefaultView;
            //	dataView.RowFilter = "ClassParentID = ClassID";
            foreach(DataRowView drv in dataView)
            {
                Microsoft.Web.UI.WebControls.TreeNode tn    = new Microsoft.Web.UI.WebControls.TreeNode();
                tn.ID		   = drv["ClassID"].ToString();
                tn.Text		   = "<span onmousemove=javascript:title='"+drv["ClassName"]+"'>"+drv["ClassName"].ToString()+"</span>";
                tn.ImageUrl    = GetIcon(drv["ClassType"].ToString());
                tn.NavigateUrl = "RightList.aspx?ClassID="+drv["ClassID"].ToString() + "&SrcID=" + SrcID.ToString() + "&DisplayType=" + DisplayType.ToString();
                tn.Target      = "RightList";
                TNC.Add(tn);
                InitChildNodeDataTable(Int32.Parse(tn.ID.ToString()));
                InitTreeChildNode(tn.Nodes,tn.ID);
            }
            dataTbl1 = null;
            dataTbl2 = null;

            Microsoft.Web.UI.WebControls.TreeNode tnn    = new Microsoft.Web.UI.WebControls.TreeNode();
            tnn.ID		   = "0";
            tnn.Text		   = "<span onmousemove=javascript:title='ȫ�ֶ���'>ȫ�ֶ���</span>";
            tnn.ImageUrl    = GetIcon("-1");
            tnn.NavigateUrl = "RightList.aspx?ClassID=0&SrcID=" + SrcID.ToString() + "&DisplayType=" + DisplayType.ToString();
            tnn.Target      = "RightList";
            TNC.Add(tnn);
        }
Пример #57
0
    private void LoadModuleTree()
    {
        IList ilModuleType = ModuleTypeSrv.GetAllTopModuleType();

        //增加模块
        foreach (ModuleType mt in ilModuleType)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            tvModules.Nodes[0].Nodes.Add(node);
            node.Type = "moduletype";
            node.Text = mt.Name;
            node.PKId = mt.Id;
            node.OrderId = mt.OrderId.ToString();

            AddSubNodes(node, mt);

            node.Expanded = true;
        }

        tvModules.Nodes[0].Expanded = true;
    }
Пример #58
0
    private void LoadModuleTree()
    {
        //获取当前登录的职员信息。
        StaffSession ss = SessionUtil.GetStaffSession();
        Staff s = CommonSrv.LoadObjectById(typeof(Staff), ss.LoginId) as Staff;

        //获取所有顶层模块。
        IList ilModuleType = ModuleTypeSrv.GetAllTopModuleType();

        //增加模块分类和模块。
        foreach (ModuleType mt in ilModuleType)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            tvModules.Nodes.Add(node);
            node.Type = "moduletype";
            node.Text = mt.Name;
            AddSubNodes(node, mt, s);
            node.Expanded = true;
        }

        //删除不必要的模块分类节点。
        RemoveNeedlessModuleType(null);
    }
Пример #59
0
 /// <summary>
 /// ��ʼ��TreeView �� ChildNode
 /// </summary>
 private void InitTreeChildNode(Microsoft.Web.UI.WebControls.TreeNodeCollection TNC, string classParentID)
 {
     DataView dataView  = new DataView();
     dataView		   = dataTbl2.Copy().DefaultView ;
     dataView.RowFilter = "ClassParentID = " + classParentID + "";
     foreach(DataRowView drv in dataView)
     {
         Microsoft.Web.UI.WebControls.TreeNode tn    = new Microsoft.Web.UI.WebControls.TreeNode();
         tn.ID		   = drv["ClassID"].ToString();
         tn.Text		   = "<span onmousemove=javascript:title='"+drv["ClassName"]+"'>"+drv["ClassName"].ToString()+"</span>";
         tn.ImageUrl    = GetIcon(drv["ClassType"].ToString());
         tn.NavigateUrl = "RightList.aspx?ClassID="+drv["ClassID"].ToString() + "&SrcID=" + SrcID.ToString() + "&DisplayType=" + DisplayType.ToString();
         tn.Target      = "RightList";
         TNC.Add(tn);
         InitTreeChildNode(tn.Nodes,tn.ID);
     }
 }
Пример #60
0
        /// <summary>
        /// ��ʼ��TreeView �� RootNode
        /// </summary>
        private void InitTreeRootNode(Microsoft.Web.UI.WebControls.TreeNodeCollection TNC)
        {
            DataView dataView  = new DataView();
            dataView		   = dataTbl1.Copy().DefaultView;
            //	dataView.RowFilter = "ClassParentID = ClassID";
            foreach(DataRowView drv in dataView)
            {
                Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode();
                tn.ID		   = drv["ClassID"].ToString();
                tn.Text		   = "<span onmousemove=javascript:title='"+drv["ClassName"]+"'>"+drv["ClassName"].ToString()+"</span>";
                //tn.ImageUrl    = GetIcon(drv["ClassType"].ToString());
                tn.NavigateUrl = "Switch.aspx?Action=1&ClassID="+drv["ClassID"].ToString();
                tn.Target      = "MainFrame";

                TNC.Add(tn);

                InitChildNodeDataTable(Int32.Parse(tn.ID.ToString()));
                InitTreeChildNode(tn.Nodes,tn.ID);
            }
            dataTbl1 = null;
            dataTbl2 = null;
        }