📄 fullrooms.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;
public partial class fullRooms : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
TextBox1.Text = Calendar1.TodaysDate.ToShortDateString();
Calendar1.SelectedDate = Calendar1.TodaysDate;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Calendar1.Visible = true;
}
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
if (Calendar1.SelectedDate <= Calendar1.TodaysDate)
{
Calendar1.Visible = false;
TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();
}
}
protected void Button2_Click(object sender, EventArgs e)
{
bizInfoDBConn dbConn = new bizInfoDBConn();
int totalRoomNum = 1;
int fullRoomNum = 0;
double ratio = 0.0;
ArrayList rooms = null;
TableRow row = null;
TableCell cell = null;
rooms = dbConn.getFullRoom(Calendar1.SelectedDate.AddHours(6.0));
totalRoomNum = dbConn.getTotalRoomNum();
fullRoomNum = dbConn.getFullRoomNum();
//显示所有客满房间
foreach (roomHistory room in rooms)
{
row = new TableRow();
//房间号
cell = new TableCell();
cell.Text = room.RoomId.ToString();
row.Cells.Add(cell);
//房客
cell = new TableCell();
cell.Text = room.CusName.ToString();
row.Cells.Add(cell);
//入住时间
cell = new TableCell();
cell.Text = room.CheckInTime.ToString();
row.Cells.Add(cell);
//离开时间
cell = new TableCell();
cell.Text = room.CheckOutTime.ToString();
row.Cells.Add(cell);
Table1.Rows.Add(row);
}
ratio = (double)fullRoomNum / totalRoomNum * 100.0;
TextBox2.Text = fullRoomNum.ToString() + "/" + totalRoomNum.ToString() + " = " + ratio.ToString() + "%";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -