?? 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 + -