📄 masterpage.master.cs
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using BLL;
using Entity;
public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Bind();
BindImg();
}
}
void Bind()
{
if (Session["Name"] != null)
{
HotelUserEntity HUE = HotelUserBLL.GetUserInfoByUserName(Session["Name"].ToString());
lblname.Text = HUE.Name;
if (HUE.Status == 0)
{
lblstatus.Text = "普通用户";
Session["Status"] = "普通用户";
MultiView2.ActiveViewIndex = 1;
}
else
{
lblstatus.Text = "管理员";
Session["Status"] = "管理员";
MultiView2.ActiveViewIndex = 0;
}
}
else
{
lblname.Visible = false;
lblstatus.Visible = false;
}
}
void BindImg()
{
DataTable dt = RoomTypeBLL.GetImageURL();
DataList1.DataSource = dt;
DataList1.DataBind();
}
protected void DataList1_SelectedIndexChanged(object sender, EventArgs e)
{
int typeid = Convert.ToInt32(DataList1.DataKeys[DataList1.SelectedIndex]);
Response.Redirect("selectRoomtypeInfo.aspx?typeid="+typeid);
}
protected void LinkButton14_Click(object sender, EventArgs e)
{
Label10.Text = "管理员是管理本系统的用户,普通用户则是该酒店的消费者。";
MultiView3.ActiveViewIndex = 0;
}
protected void LinkButton13_Click(object sender, EventArgs e)
{
Label9.Text = "客房类型管理(编辑房间类型、删除房间类型、增加房间类型)、客房信息管理(编辑房间信息、删除房间信息、增加房间信息)、用户预订管理(对用户的档案进行操作、用户接待进行管理)。";
MultiView3.ActiveViewIndex = 1;
}
protected void LinkButton15_Click1(object sender, EventArgs e)
{
MultiView4.ActiveViewIndex = 0;
}
protected void LinkButton12_Click(object sender, EventArgs e)
{
Label12.Text = "用户在线预订房间,在线退房。";
MultiView3.ActiveViewIndex = 2;
}
protected void LinkButton11_Click(object sender, EventArgs e)
{
Label14.Text = "管理员修改用户权限需慎重。";
MultiView3.ActiveViewIndex = 3;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -