⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 incomeinfo.aspx.cs

📁 酒店管理系统
💻 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 bizInfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            TextBox1.Text = Calendar1.TodaysDate.ToShortDateString();
            Calendar1.SelectedDate = Calendar1.TodaysDate;
            TextBox2.Text = Calendar2.TodaysDate.ToShortDateString();
            Calendar2.SelectedDate = Calendar2.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)
    {
        Calendar2.Visible = true;
    }

    protected void Calendar2_SelectionChanged(object sender, EventArgs e)
    {
        if (Calendar2.SelectedDate <= Calendar2.TodaysDate)
        {
            Calendar2.Visible = false;
            TextBox2.Text = Calendar2.SelectedDate.ToShortDateString();
        }
    }

    protected void Button3_Click(object sender, EventArgs e)
    {
        bizInfoDBConn dbConn = new bizInfoDBConn();
        double totalIncome = 0.0;
        ArrayList rooms = null;
        TableRow row = null;
        TableCell cell = null;

        rooms = dbConn.getRoomIncome(Calendar1.SelectedDate, Calendar2.SelectedDate.AddDays(1.0));

        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);

            //金额
            cell = new TableCell();
            cell.Text = room.Rent.ToString();
            row.Cells.Add(cell);

            totalIncome += room.Rent;

            Table1.Rows.Add(row);
        }
        TextBox3.Text = totalIncome.ToString();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -