⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 top.aspx.cs

📁 可供共享学习.net环境下生产管理的实现
💻 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>
	/// Top 的摘要说明。
	/// </summary>
	public class Top : BasePage
	{
		protected System.Web.UI.WebControls.Label lblId;
		protected System.Web.UI.WebControls.Button btnModify;
		protected System.Web.UI.WebControls.Button Button1;
		protected System.Web.UI.WebControls.Label lblUserName;
		protected System.Web.UI.WebControls.Button btnActive;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			this.btnModify.Attributes.Add("onClick","Javascript:window.open('Modules/UserSettings/SelfModify.aspx','main')");
			this.btnActive.Attributes.Add("onClick","Javascript:window.open('Demo.aspx','main');return false;");
			this.Button1.Attributes.Add("onClick","javascript:return confirm('确定要退出吗?')");
			if(!Page.IsPostBack)
			{
				this.InitPage();
			}

		}

		private void InitPage()
		{
			if(Session["User"]!=null)
			{
				Framework.Principal p=(Principal)Session["User"];
				this.lblId.Text = p.Id;
				this.lblUserName.Text =p.UserName;
				if(p.IsSuper=="Y")
				{
					this.lblId.Text +="[超级管理员]";
					this.lblId.ForeColor=Color.Red;
					this.lblUserName.ForeColor=this.lblId.ForeColor;
				}
			}
		}	

		#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.btnActive.Click += new System.EventHandler(this.btnActive_Click);
			this.Button1.Click += new System.EventHandler(this.Button1_Click);
			this.btnModify.Click += new System.EventHandler(this.btnModify_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void Button1_Click(object sender, System.EventArgs e)
		{
			Session["User"]="";
			Response.Write(@"<script>parent.location='"+Request.ApplicationPath + "/" + g.LOGIN_PAGE+"'</script>");
		}

		private void btnActive_Click(object sender, System.EventArgs e)
		{
		
		}

		private void btnModify_Click(object sender, System.EventArgs e)
		{
		
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -