Пример #1
0
 private void CreateTree()
 {
     try
     {
         string strUserGropCode = this.txtUserGropCode.Value;
         string strRoleCode     = this.txtRoleCode.Value;
         KingTop.BLL.SysManage.RightTool     objRight = new KingTop.BLL.SysManage.RightTool();
         System.Web.UI.WebControls.TableCell objCell  = new TableCell();
         System.Web.UI.WebControls.TableRow  objRow   = new TableRow();
         objRow  = objRight.CreateRow(ref this.tblMain);
         objCell = objRight.CreateCell(ref objRow);
         objRight.UserGropCode = strUserGropCode;
         objRight.RoleCode     = strRoleCode;
         objRight.LogUserPK    = base.GetLoginAccountId();
         objRight.SiteID       = SiteID;
         objRight.SetModuleRightList3(UserID, "");
         objRight.ArrEnable2("");
         objRight.CreateTree("", ref objCell, "", null, GetLoginAccountId(), GetLoginUserGroupCode());
         objRow.Controls.Add(objCell);
         tblMain.Controls.Add(objRow);
         objRight = null;
         return;
     }
     catch { }
 }
 private void CreateTree()
 {
     try
     {
         KingTop.BLL.SysManage.UserGroup objUserGroup = new KingTop.BLL.SysManage.UserGroup();
         string ParentGroupID = "";
         //父用户组ID
         DataTable dt = objUserGroup.GetList("GETPARENTGROUP", Utils.getOneParams(txtUserGropCode.Value)).Tables[0];
         if (dt != null && dt.Rows.Count > 0)
         {
             ParentGroupID = dt.Rows[0]["UserGroupCode"].ToString();
         }
         string strUserGropCode = this.txtUserGropCode.Value;
         string strRoleCode     = this.txtRoleCode.Value;
         KingTop.BLL.SysManage.RightTool     objRight = new KingTop.BLL.SysManage.RightTool();
         System.Web.UI.WebControls.TableCell objCell  = new TableCell();
         System.Web.UI.WebControls.TableRow  objRow   = new TableRow();
         objRow  = objRight.CreateRow(ref this.tblMain);
         objCell = objRight.CreateCell(ref objRow);
         objRight.UserGropCode = strUserGropCode;
         objRight.RoleCode     = strRoleCode;
         objRight.LogUserPK    = base.GetLoginAccountId();
         objRight.SiteID       = SiteID;
         ArrayList arrRigth1 = (ArrayList)objRight.SetModuleRightList("").Clone();
         ArrayList arrRigth2 = objRight.ArrEnable("");
         //移除用户组所有权限中角色的权限并赋给arrOldRigth
         for (int i = 0; i < arrRigth1.Count; i++)
         {
             for (int j = 0; j < arrRigth2.Count; j++)
             {
                 if (arrRigth2[j].ToString() == arrRigth1[i].ToString())
                 {
                     arrRigth1.Remove(arrRigth2[j]);
                     i = i - 1;
                     break;
                 }
             }
         }
         arrOldRigth = arrRigth1;
         objRight.CreateTree("", ref objCell, ParentGroupID, null, GetLoginAccountId(), GetLoginUserGroupCode());
         objRow.Controls.Add(objCell);
         tblMain.Controls.Add(objRow);
         objRight = null;
         return;
     }
     catch { }
 }
 private void CreateTree()
 {
     try
     {
         int TemplateID = Utils.ParseInt(this.txtTemplate.Value, 0);
         KingTop.BLL.SysManage.RightTool     objRight = new KingTop.BLL.SysManage.RightTool();
         System.Web.UI.WebControls.TableCell objCell  = new TableCell();
         System.Web.UI.WebControls.TableRow  objRow   = new TableRow();
         objRow              = objRight.CreateRow(ref this.tblMain);
         objCell             = objRight.CreateCell(ref objRow);
         objRight.TemplateID = TemplateID;
         objRight.SetTemplateRightList(TemplateID, "");
         objRight.CreateTree("", ref objCell, TemplateID);
         objRow.Controls.Add(objCell);
         tblMain.Controls.Add(objRow);
         objRight = null;
         return;
     }
     catch { }
 }