📄 default.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>
/// _Default 的摘要说明。
/// </summary>
public class _Default : BasePage
{
protected System.Web.UI.WebControls.TextBox txtUser;
protected System.Web.UI.WebControls.TextBox txtPWD;
protected System.Web.UI.WebControls.Label lblAlert;
protected System.Web.UI.WebControls.Button Button1;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!Page.IsPostBack)
{
InitPage();
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
this.DefaultValidate=false;
this.DemoCheck=false;
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void InitPage()
{
this.lblAlert.Text="";
}
private void Button1_Click(object sender, System.EventArgs e)
{
string userId=this.txtUser.Text.Trim();
string password=this.txtPWD.Text.Trim();
Framework.Principal p=new Framework.Principal();
if(p.Login(userId,password))
{
if(p.Flag!="Y")
this.lblAlert.Text ="登录失败:此管理员未激活!";
else
{
Session["User"]=p;
//Response.Redirect("Main.aspx");
Response.Write(@"<script> YANGHUIWIN=window.open('main.aspx','YANGHUI','height='+ new String(screen.availHeight-28) + ',top=0,left=0,width=' + new String(screen.availWidth-10) + ',location=no,menubar=no,resizable=no,toolbar=no');</script>");
Response.End();
}
}
else
{
this.lblAlert.Text="登录失败,请输入合法的管理员帐号和密码!";
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -