📄 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 com.unicafe.security;
namespace PLP_DRP
{
/// <summary>
/// _Default 的摘要说明。
/// </summary>
public class _Default : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.HtmlControls.HtmlForm Form1;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if (IsPostBack)
{
com.unicafe.security.SecurityMgr sm = new com.unicafe.security.SecurityMgr();
if(sm.Logon(Request.Form["txtUser"].ToString(),Request.Form["txtPwd"].ToString(),this))
{
com.unicafe.security.Employee empl = sm.GetEmployee(Request.Form["txtUser"].ToString());
SYSLOG sl = new SYSLOG();
sl.EmplID = empl.EmplID;
sl.IP = Request.ServerVariables["REMOTE_ADDR"].ToString();
sl.UserName = Request.Form["txtUser"]+"";
sm.AddSYSLOG(sl);
HttpCookie cookie1 = new HttpCookie("CurrentEmplID",empl.EmplID);
Response.AppendCookie(cookie1);
HttpCookie cookie2 = new HttpCookie("LastLogonName", Request.Form["txtUser"].ToString());
Response.AppendCookie(cookie2);
Response.Redirect("Main.aspx",true);
}
else
{
Label1.Text = "<script language=javascript>alert('您输入的密码不正确,或者该用户不存在,请重试。');</script>";
}
//Response.Redirect("organization/Default.aspx",true);
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
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 + -