📄 roomstatusform.aspx.cs
字号:
//文件名:RoomStatusForm.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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.Data.SqlClient;
public partial class QueryManage_RoomStatusForm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string MyForbidString = Session["MyForbid"].ToString();
if (MyForbidString.IndexOf("C2") > 1)
{
Server.Transfer("~/SystemManage/AllErrorHelp.aspx");
}
this.Page.Title = "当前位置:查询管理->查询客房信息";
this.Label1.Text = Session["MyCompanyName"].ToString()+"客房当前入住状态图";
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{//设置有客人入住的房号单元格背景颜色
if (e.Row.RowType == DataControlRowType.DataRow)
{
if(Convert.ToInt16(e.Row.Cells[2].Text)>0)
{
e.Row.Cells[2].BackColor = System.Drawing.Color.LightBlue;
}
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{//显示客房客人的基本登记信息
string My房号 = this.GridView1.SelectedRow.Cells[1].Text;
this.Label2.Text = My房号 + "房间当前入住客人的基本登记信息";
String MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyHotelDBConnectionString"].ConnectionString;
string MySQL = "Select 入住编号,入住房号,客人姓名,住宿人数,联系电话,客人性别 From 客房入住单 Where 入住房号='" + My房号 + "' AND 入住编号 NOT IN (Select 入住编号 From 客房结账单)";
this.SqlDataSource2.ConnectionString = MySQLConnectionString;
this.SqlDataSource2.SelectCommand = MySQL;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -