Ejemplo n.º 1
0
    private void BindTreeView()
    {
        //清空树
        tvModuleTree.Nodes.Clear();
        DataTable dt = new BllTableObject("IACenter_Menu").Util_GetList("*", "1=1");

        TreeNode treenote = new TreeNode("系统菜单");

        tvModuleTree.Nodes.Add(treenote);
        if (dt.Rows.Count > 0)
        {
            string    filter = " parentMenuId=0 ";
            DataRow[] rows   = dt.Select(filter, "orderIndex asc");
            foreach (DataRow row in rows)
            {
                TreeNode tn = new TreeNode();
                string   id = row["uniqueId"].ToString();
                tn.Text         = row["menuName"].ToString();
                tn.Value        = row["uniqueId"].ToString();
                tn.ShowCheckBox = false;
                tn.NavigateUrl  = "GroupMenuSetIframe.aspx?menuId=" + id + "&groupId=" + this.id;
                tn.Target       = "mainList";
                tn.Expanded     = true;
                BindNode(tn, dt, id);
                treenote.ChildNodes.Add(tn);
            }
        }
    }
Ejemplo n.º 2
0
 protected void InitForm()
 {
     if (this.id != "")
     {
         DataTable dt = new BllTableObject("IACenter_Group").Util_GetList("*", "uniqueId=" + this.id + "");
         if (dt.Rows.Count > 0)
         {
             this.txtTitle.Value = dt.Rows[0]["groupName"].ToString();
             //users
             DataTable dtUsers = new BllTableObject("IACenter_UserInGroup").Util_GetList("*", "groupId=" + this.id + "");
             DataTable dtUser  = new BllTableObject("IACenter_User").Util_GetList("*", "1=1");
             string    values  = "";
             string    texts   = "";
             foreach (DataRow row in dtUsers.Rows)
             {
                 values += row["userid"].ToString() + ",";
                 DataRow[] rowUserInfo = dtUser.Select("uniqueId='" + row["userid"].ToString() + "'");
                 if (rowUserInfo.Length > 0)
                 {
                     texts += rowUserInfo[0]["truename"].ToString() + ",";
                 }
                 else
                 {
                     texts += ",";
                 }
             }
             if (values.Length > 0)
             {
                 values = values.TrimEnd(',');
             }
             if (texts.Length > 0)
             {
                 texts = texts.TrimEnd(',');
             }
             this.SelectPanel1.Value = values;
             this.SelectPanel1.Text  = texts;
         }
     }
 }