日期:2014-05-17 浏览次数:20694 次
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using AGV.BLL;
using System.Drawing;
using System.Net;
public partial class left : System.Web.UI.Page
{
DataTable dt_Role = new DataTable();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string cookies_User = Request.Cookies["USER_COOKIE"]["UserName"];
dt_Role = new sys_SetRoleManager().GetUserRoleByUserID(cookies_User);
DataTable newdt = new DataTable();
newdt = dt_Role.Clone();
newdt = dt_Role.DefaultView.ToTable(true, "MenuGroupName");
tvMenu.ShowLines = true;
foreach (DataRow i in newdt.Rows)
{
TreeNode leveNode1 = new TreeNode();
leveNode1.Text = i["MenuGroupName"].ToString();
leveNode1.ImageUrl = "~/Images/TreeViewPic/web2.png";
leveNode1.Expanded = false;
leveNode1.SelectAction = TreeNodeSelectAction.Expand;
tvMenu.Nodes.Add(leveNode1);
}
for (int i = 0; i < tvMenu.Nodes.Count; i++)
{
for (int j = 0; j < dt_Role.Rows.Count; j++)
{
if (tvMenu.Nodes[i].Text.Trim() == dt_Role.Rows[j]["MenuGroupName"].ToString())
&n