日期:2014-05-18 浏览次数:20387 次
using System; using System.Data; using System.Data.OleDb; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using DataProvider; using WavenetWebFrameWork.FrameWorkBase.PageBase; namespace WaveDBMS { public partial class NewMenu : System.Web.UI.Page { #region ARGS private TreeNode[] treF, treC,treGs; private TreeNode treG; private string[] strF, strC,strCL,strGs,strGsL; private string strCon,strDBType,strUID; protected DataProviderFactory dpf; private string strSqlF, strSqlC, strSqlGs; private DataTable dtF,dtC,dtGs; private int intFRowsLength, intCRowsLength, intGsRowsLength; PageBase pb = new PageBase(); public string UserID { get { return strUID; } set { strUID = value; } } #endregion protected void Page_Load(object sender, EventArgs e) { strCon = System.Configuration.ConfigurationSettings.AppSettings.Get("UserAppData"); strDBType = System.Configuration.ConfigurationSettings.AppSettings.Get("UserAppDataType"); strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"" + strCon + "\";Persist Security Info=True"; strCon = pb.userappdata; dpf = new DataProviderFactory(strDBType, strCon, ""); strUID = "1"; if(!IsPostBack) { treG = new TreeNode(); treG.Text = "排水行业数据库"; treG.ImageUrl = "~/Images/database1.gif"; this.TreeV.Nodes.Add(treG); this.BuildTrees(); } } protected void BuildTrees() { strSqlF = "SELECT ID,MENUNAME,LINKURL FROM MENU WHERE PARENTID=-1"; String strSqlF4 = ""; strSqlF4 = "SELECT MENU.ID AS AA,MENU.MENUNAME AS BB,MENU.LINKURL AS CC,MENU.PARENTID AS DD "; strSqlF4 += " FROM MENU,RULES,ROLE2RULE "; strSqlF4 += " WHERE MENU.ID = RULES.MENUID "; strSqlF4 += " AND RULES.RULEID = ROLE2RULE.RULEID"; strSqlF4 += " AND ROLE2RULE.ROLEID = "+strUID ; strSqlF4 += " AND ROLE2RULE.RULEACTIONVALUE=1"; //strSqlF = "SELECT MENU2.AA,MENU2.BB,MENU2.CC,MENU2.DD FROM (