温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:酒店管理系统(三层开发)源码
当前文件:
ThreeLayerHotel/WebSite_hotel/Index.aspx.cs,打开代码结构图
ThreeLayerHotel/WebSite_hotel/Index.aspx.cs,打开代码结构图1using System; 2
using System.Collections; 3
using System.Configuration; 4
using System.Data; 5
using System.Linq; 6
using System.Web; 7
using System.Web.Security; 8
using System.Web.UI; 9
using System.Web.UI.HtmlControls; 10
using System.Web.UI.WebControls; 11
using System.Web.UI.WebControls.WebParts; 12
using System.Xml.Linq; 13
using BLL; 14
using Entity; 15
16
public partial class Index : System.Web.UI.Page 17
{ 18
protected void Page_Load(object sender, EventArgs e) 19
{ 20
if (!IsPostBack) 21
{ 22
if (Session["Name"] == null) 23
{ 24
MPE.Show(); 25
} 26
MultiView1.ActiveViewIndex = 0; 27
} 28
} 29
protected void ibtnLogin_Click(object sender, ImageClickEventArgs e) 30
{ 31
HotelUserEntity HUE = new HotelUserEntity(); 32
HUE.Password = txtpassword.Text; 33
HUE.UserName = txtusername.Text; 34
string str = HotelUserBLL.ExistUser(HUE); 35
if (str == "成功") 36
{ 37
Session["Name"] = txtusername.Text; 38
Response.Redirect("index.aspx"); 39
MPE.Hide(); 40
41
} 42
else 43
{ 44
MPE.Show(); 45
lblmsg.Visible = true; 46
lblmsg.Text = "登录失败,用户名或密码错误!" ; 47
} 48
} 49
} 50





}
}