📄 left.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Botheighten.Yanghui.BusinessFacade;
using Botheighten.Yanghui.Framework;
using Botheighten.Yanghui.BusinessRules;
namespace Botheighten.Yanghui.Web
{
/// <summary>
/// Left 的摘要说明。
/// </summary>
public class Left : BasePage
{
//protected Microsoft.Web.UI.WebControls.TreeView TreeView1;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if (!this.IsPostBack )
{
this.InitPage ();
}
}
private void InitPage()
{
DataTable dt=LoginSystem.GetCatalog("Y");
//TreeView initialize
string s = "",catalogId;
//TreeNode tn = null;
Response.Write(@"<SCRIPT LANGUAGE='JavaScript' src='showlayer.js'></SCRIPT>");
string resString="";
resString +=@"<table width='191' height='100%' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td width='13' background='images/index_vlineleft.gif'> </td>
<td width='167' height='450' align='middle' valign='top' bgcolor='#edf4fc' class='text'><br>
<img src='images/titleyanghui.jpg' width='162'>
<br>
<div id='Layer1' style='Z-INDEX:1; LEFT:30px; VISIBILITY:visible; WIDTH:160px; POSITION:absolute; TOP:55px'>
<div align='right' id='MFX0' style='Z-INDEX:2; LEFT:0px; VISIBILITY:hidden; WIDTH:155px; POSITION:absolute; TOP:0px; HEIGHT:28px'>
<table width='191' border='0' cellspacing='0' cellpadding='5' height='20'>
<tr>
<td width='14' class=''><img src='images/index_titleyellow.gif'>
</td>
<td height='20' background='images/index_menubg.gif' class='norepeat'>
<a href='welcome.aspx' target='main' onClick='MFXrunMenu(0,20)'>首页</a></td>
</tr>
</table>
</div>
<div id='MFX1' align='right' style='BORDER-RIGHT:#000000 1px; BORDER-TOP:#000000 1px; Z-INDEX:1; LEFT:0px; VISIBILITY:hidden; BORDER-LEFT:#000000 1px; WIDTH:159px; BORDER-BOTTOM:#000000 1px; POSITION:absolute; TOP:25px; HEIGHT:10px'>
</div>";
//string resSubString="";
for ( int i = 0;i < dt.Rows.Count;i ++)
{
catalogId = dt.Rows[i][Catalog.ID].ToString ();
//如果这个node是第一次出现
if (s != catalogId)
{
//tn = new TreeNode ();
//tn.Text = dt.Rows[i][Catalog.NAME].ToString ();
//tn.ImageUrl = Request.ApplicationPath + "/Images/cat11.gif";
//tn.ImageUrl = Request.ApplicationPath + "/Images/icon_folder3.gif";
// this.TreeView1.Nodes.Add (tn);
//tn.ExpandedImageUrl = Request.ApplicationPath + "/Images/cat11.gif";
//tn.ExpandedImageUrl = Request.ApplicationPath + "/Images/icon_folder4.gif";
s = catalogId;
//开始输出主菜单
string thisIndex=((i+1)*2).ToString();
resString +=@"<div align='right' id='MFX" + thisIndex + @"' style='Z-INDEX:2; LEFT:0px; VISIBILITY:hidden; WIDTH:155px; POSITION:absolute; TOP:0px; HEIGHT:28px'>
<table width='191' border='0' cellspacing='0' cellpadding='5' height='20'>
<tr>
<td width='14' class=''><img src='images/index_titleblue.gif'>
</td>
<td height='20' background='images/index_menubg.gif' class='norepeat'>
<a href='#' onClick='MFXrunMenu(" + thisIndex+ @",20);'>" + dt.Rows[i][Catalog.NAME].ToString () + @"</a></td>
</tr>
</table>
</div>";
}
//添加子结点
DataTable dtv=LoginSystem.GetPage(catalogId,"Y");
//开始输出子结点
int recordcount=0; string restemp="";
for(int j=0;j<dtv.Rows.Count;j ++)
{
Principal p=this.CurrentUser();
if(LoginSystem.CheckPermission(p.Id,"",dtv.Rows[j][BusinessRules.Page.CODE].ToString()))
{
//TreeNode t = new TreeNode ();
//t.Text = dtv.Rows[j][BusinessRules.Page.NAME].ToString ();
//t.ImageUrl = Request.ApplicationPath + "/Images/cat21.gif";
//t.NavigateUrl = Request.ApplicationPath + dt.Rows[i][CatalogSystem.PAGE_URL].ToString ();
//t.NavigateUrl = Request.ApplicationPath +"/"+ dtv.Rows[j][BusinessRules.Page.URL].ToString ();
//t.Target = "main";
//tn.Nodes.Add (t);
//开始添加子结点
restemp +=@"<tr>
<td height='25' width='20'> </td>
<td class='norepeat'><img src='images/index_chititle.gif'> <a href='"+ Request.ApplicationPath +"/"+ dtv.Rows[j][BusinessRules.Page.URL].ToString () +@"' target='main'>"+dtv.Rows[j][BusinessRules.Page.NAME].ToString () +@"</a></td>
</tr>";
recordcount++;
}
}
resString +=@"<div id='MFX"+ (((i+1)*2)+1).ToString() +@"' align='right' style='BORDER-RIGHT:#000000 1px; BORDER-TOP:#000000 1px; Z-INDEX:1; LEFT:0px; VISIBILITY:hidden; BORDER-LEFT:#000000 1px; WIDTH:159px; BORDER-BOTTOM:#000000 1px; POSITION:absolute; TOP:25px; HEIGHT:" + (recordcount * 25).ToString() +@"px'>";
if(recordcount>0)
{
resString +="<table width='159' border='0' cellspacing='0' background='images/index_chimenubg.gif'>";
}
resString +=restemp;
if(recordcount>0)
{
resString +="</table>";
}
resString +=@"</div>";
}
resString +=@"</div>
</td>
<td width='11' background='images/index_vlinemid.gif'> </td>
</tr>
</table>";
Response.Write(resString);
Response.Write(@"<script>allLayes="+((dt.Rows.Count*2)+1).ToString()+"</script>");
//Response.Write(resSubString);
//Response.Write(@"<script>onload='MFXinitMenu()'</script>");
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
this.DemoCheck=false;
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -