コード例 #1
0
            //得到角色权限数组
            private ArrayList GetRoleArray(string strUserGropCode)
            {
                //现在每判断一个单元格CheckBox都要取数据库,待修改
                ArrayList       arrUserGroupList   = new ArrayList();
                ColumnRightTool bllColumnRightTool = new ColumnRightTool();

                arrUserGroupList = bllColumnRightTool.GetUserGroupRightList("Role", strUserGropCode, strNodeID);
                return(arrUserGroupList);
            }
コード例 #2
0
        protected void SaveRightDate(string strNodeID)
        {
            //得到操作列表
            KingTop.BLL.SysManage.ActionPermit bllActionPer = new ActionPermit();
            DataTable dt2 = bllActionPer.GetList("MODULE", Utils.getOneParams(ddlModel.SelectedValue));

            if (AppCache.IsExist("ModuleActionCache"))
            {
                AppCache.Remove("ModuleActionCache");
            }

            //if (AppCache.IsExist("ModeNodeAndModuleCache"))
            //{
            //    AppCache.Remove("ModeNodeAndModuleCache");
            //}

            if (AppCache.IsExist("UserGroupPermitCache"))
            {
                AppCache.Remove("UserGroupPermitCache");
            }

            for (int i = 0; i < grvRight.Rows.Count; i++)
            {
                ArrayList arrRightSet = new ArrayList();
                foreach (DataRow dr in dt2.Rows)
                {
                    string   ckbid = "ckb" + dr["ID"].ToString();
                    CheckBox ckb   = (CheckBox)grvRight.Rows[i].FindControl(ckbid);
                    if (ckb.Checked && ckb.Enabled == true)
                    {
                        arrRightSet.Add(dr["ID"].ToString());
                    }
                }
                //更新权限
                if (arrRightSet.Count > 0)
                {
                    ColumnRightTool coluRightTool    = new ColumnRightTool();
                    string          strUserGroupCode = grvRight.Rows[i].Cells[0].Text;
                    coluRightTool.SaveData(strUserGroupCode, arrRightSet, strNodeID);
                }
            }
        }