View/Users/Booking.aspx.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace EHotelMS.View.Users
{
    public partial class Booking : System.Web.UI.Page
    {
        Models.Functions Con;

        protected void Page_Load(object sender, EventArgs e)
        {
            Con = new Models.Functions();
            ShowRooms();
            ShowBookings();
        }

        private void ShowRooms()
        {
            string St = "空閑";
            string Query = "select RId as Id,RName as Name,RCategory as categories,RCost as Cost,Status as Status from RoomTb1 where Status = '" + St + "'";
            RoomsGV.DataSource = Con.GetData(Query);
            RoomsGV.DataBind();
            RoomsGV.HeaderRow.Cells[1].Text = "房號";
            RoomsGV.HeaderRow.Cells[2].Text = "客房名稱";
            RoomsGV.HeaderRow.Cells[3].Text = "房型";
            //RoomsGV.HeaderRow.Cells[4].Text = "位置";
            RoomsGV.HeaderRow.Cells[4].Text = "價格";
            //RoomsGV.HeaderRow.Cells[6].Text = "标签";
            RoomsGV.HeaderRow.Cells[5].Text = "狀態";
        }

        private void ShowBookings()
        {
            string Query = "select* from BookingTb1";
            BookingGV.DataSource = Con.GetData(Query);
            BookingGV.DataBind();
            BookingGV.HeaderRow.Cells[1].Text = "訂單號";
            BookingGV.HeaderRow.Cells[2].Text = "當前日期";
            BookingGV.HeaderRow.Cells[3].Text = "房號";

            BookingGV.HeaderRow.Cells[4].Text = "用戶ID";

            BookingGV.HeaderRow.Cells[5].Text = "入住時間";
            BookingGV.HeaderRow.Cells[6].Text = "退房時間";
            BookingGV.HeaderRow.Cells[7].Text = "總價";
        }

        int Key = 0;
        int Days = 1;
        protected void RoomsGV_SelectedIndexChanged(object sender, EventArgs e)
        {
            Key = Convert.ToInt32(RoomsGV.SelectedRow.Cells[1].Text);
            RoomTb.Value = RoomsGV.SelectedRow.Cells[2].Text;
            int Cost = Days * Convert.ToInt32(RoomsGV.SelectedRow.Cells[4].Text);
            AmountTb.Value = Cost.ToString();
        }
后面还有 58 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。