Web/Admin/Left.aspx.cs

(开头部分) 7KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Web.UI.WebControls;
using Microsoft.Web.UI.WebControls;
using LTP.Accounts.Bus;
using System.Configuration;

namespace Maticsoft.Web.Admin
{
	/// <summary>
	/// Left 的摘要说明。
	/// </summary>
	public partial class Left : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Label lblMsg;


		AccountsPrincipal user;
		User currentUser;
		public string strWelcome;
		protected void Page_Load(object sender, System.EventArgs e)
		{
				
			if(!Page.IsPostBack)
			{
				user=new AccountsPrincipal(Context.User.Identity.Name);
				if(Session["UserInfo"]==null)
				{
					return ;				
				}
				currentUser=(LTP.Accounts.Bus.User)Session["UserInfo"];
				Maticsoft.BLL.SysManage sm=new Maticsoft.BLL.SysManage();
				DataSet ds;			
				ds=sm.GetTreeList("");
				BindTreeView("mainFrame",ds.Tables[0]);

				if(this.TreeView1.Nodes.Count==0)
				{
					strWelcome+="<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;但你没有任何模块的访问权";
				}
				
			}
		}

		//邦定根节点
		public void  BindTreeView(string TargetFrame,DataTable dt)
		{
			DataRow [] drs = dt.Select("ParentID= " + 0);// 选出所有子节点	
			
			//菜单状态
			string MenuExpanded=ConfigurationManager.AppSettings.Get("MenuExpanded");
			bool menuExpand=bool.Parse(MenuExpanded);

			TreeView1.Nodes.Clear(); // 清空树
			foreach( DataRow r in drs )
			{
				string nodeid=r["NodeID"].ToString();				
				string text=r["Text"].ToString();					
				string parentid=r["ParentID"].ToString();
				string location=r["Location"].ToString();
后面还有 187 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。