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

📄 telephoneprint.aspx.cs

📁 一个关于宾馆酒店管理系统的源代码
💻 CS
字号:
//文件名:TelephonePrint.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 ConsumeManage_TelephonePrint : System.Web.UI.Page
{
    private ConsumeManage_TelephoneForm MyTelephoneForm;
    protected void Page_Load(object sender, EventArgs e)
    {//显示旅客话费登记信息
        MyTelephoneForm = (ConsumeManage_TelephoneForm)Context.Handler;
        string MyTitle = Session["MyCompanyName"].ToString() + "话费登记单";
        string My话费编号 = "话费编号:" + MyTelephoneForm.MyTable.Rows[0][2].ToString();
        string My入住编号 = "        入住编号:" + MyTelephoneForm.MyTable.Rows[0][1].ToString();
        string My操作人员 = "操作人员:" + MyTelephoneForm.MyTable.Rows[0][8].ToString();
        string My打印日期 = "          打印日期:" + DateTime.Now.ToLongDateString();
        string My入住房号 = "房号:" + MyTelephoneForm.My入住房号;
        string My客人姓名 = "          姓名:" + MyTelephoneForm.My客人姓名;
        this.Label1.Text = MyTitle;
        this.Label2.Text = My话费编号;
        this.Label3.Text = My操作人员;

        TableRow row = new TableRow();
        TableCell cell = new TableCell();
        cell.HorizontalAlign = HorizontalAlign.Left;
        cell.ColumnSpan = 5;
        cell.Width = 600;
        cell.Text = "   " + My入住房号
            + "   &nbsp" + My客人姓名
            + "   &nbsp" + My入住编号
            + "   &nbsp" + My打印日期;
        row.Cells.Add(cell);
        this.Table1.Rows.Add(row);

        TableRow row1 = new TableRow();
        TableCell cell1 = new TableCell();
        cell1.HorizontalAlign = HorizontalAlign.Center;
        cell1.Text = "序号";
        cell1.Width = 50;
        row1.Cells.Add(cell1);
        TableCell cell2 = new TableCell();
        cell2.HorizontalAlign = HorizontalAlign.Center;
        cell2.Text = "通话时间";
        cell2.Width = 150;
        row1.Cells.Add(cell2);
        TableCell cell3 = new TableCell();
        cell3.HorizontalAlign = HorizontalAlign.Center;
        cell3.Text = "类别";
        cell3.Width = 100;
        row1.Cells.Add(cell3);
        TableCell cell4 = new TableCell();
        cell4.HorizontalAlign = HorizontalAlign.Center;
        cell4.Text = "金额";
        cell4.Width = 100;
        row1.Cells.Add(cell4);
        TableCell cell5 = new TableCell();
        cell5.HorizontalAlign = HorizontalAlign.Center;
        cell5.Text = "说明";
        cell5.Width = 200;
        row1.Cells.Add(cell5);
        this.Table1.Rows.Add(row1);

        Double MyAmount = 0;
        for (int i = 1; i <= MyTelephoneForm.MyTable.Rows.Count; i++)
        {
            string MyDate =DateTime.Parse(MyTelephoneForm.MyTable.Rows[i - 1][3].ToString()).ToShortDateString();
            string MyType = MyTelephoneForm.MyTable.Rows[i - 1][4].ToString();
            string MyPrice = MyTelephoneForm.MyTable.Rows[i - 1][5].ToString();
            MyAmount = MyAmount + Convert.ToDouble(MyPrice);
            string MyComment = MyTelephoneForm.MyTable.Rows[i - 1][6].ToString();
            string MyIndex = i.ToString();
            AddRow(MyIndex, MyDate, MyType, MyPrice, MyComment);
        }

        TableRow row2 = new TableRow();
        TableCell cell6 = new TableCell();
        cell6.HorizontalAlign = HorizontalAlign.Center;
        cell6.ColumnSpan = 5;
        cell6.Width = 600;
        cell6.Text = "合计金额:" + MyAmount.ToString() + "元";
        row2.Cells.Add(cell6);
        this.Table1.Rows.Add(row2);      

    }
    private void AddRow(string MyIndex, string MyDate, string MyType, string MyPrice, string MyComment)
    {
        TableRow row1 = new TableRow();
        TableCell cell1 = new TableCell();
        cell1.HorizontalAlign = HorizontalAlign.Center;
        cell1.Text = MyIndex;
        cell1.Width = 50;
        row1.Cells.Add(cell1);
        TableCell cell2 = new TableCell();
        cell2.HorizontalAlign = HorizontalAlign.Center;
        cell2.Text = MyDate;
        cell2.Width = 150;
        row1.Cells.Add(cell2);
        TableCell cell3 = new TableCell();
        cell3.HorizontalAlign = HorizontalAlign.Center;
        cell3.Text = MyType;
        cell3.Width = 100;
        row1.Cells.Add(cell3);
        TableCell cell4 = new TableCell();
        cell4.HorizontalAlign = HorizontalAlign.Center;
        cell4.Text = MyPrice;
        cell4.Width = 100;
        row1.Cells.Add(cell4);
        TableCell cell5 = new TableCell();
        cell5.HorizontalAlign = HorizontalAlign.Center;
        cell5.Text = MyComment;
        cell5.Width = 200;
        row1.Cells.Add(cell5);
        this.Table1.Rows.Add(row1);
    }
}

⌨️ 快捷键说明

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