reporttelephoneform.aspx.cs

来自「酒店源码」· CS 代码 · 共 57 行

CS
57
字号
//文件名:ReportTelephoneForm.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 ReportManage_ReportTelephoneForm : System.Web.UI.Page
{
    private static string MySQL = "Select * From 旅客话费报表视图";
    protected void Page_Load(object sender, EventArgs e)
    {
        string MyForbidString = Session["MyForbid"].ToString();
        if (MyForbidString.IndexOf("D4") > 1)
        {
            Server.Transfer("~/SystemManage/AllErrorHelp.aspx");
        }
        this.Page.Title = "当前位置:报表管理->电话消费报表";
        if (!IsPostBack)
        {
            this.TextBox2.Text = DateTime.Now.ToShortDateString();
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {//查询旅客话费信息
        string MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyHotelDBConnectionString"].ConnectionString;
        MySQL = "Select * From 旅客话费报表视图  Where 旅客话费报表视图.记账时间 Between  '" + this.TextBox1.Text + "' AND '" + this.TextBox2.Text + "'";
        this.SqlDataSource1.ConnectionString = MySQLConnectionString;
        this.SqlDataSource1.SelectCommand = MySQL;
        this.SqlDataSource1.DataBind();
        this.GridView1.DataBind();
    }
    public string MyPrintSQL
    {//设置要传递到打印页的数据
        get
        {
            return MySQL;
        }
    }
    public String MyPrintDate
    {//设置要传递到打印页的数据
        get
        {
            return "开始日期:" + this.TextBox1.Text + "  结束日期:" + this.TextBox2.Text;
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {//打印入住旅客话费信息
        Server.Transfer("~/ReportManage/ReportTelephonePrint.aspx");
    }
}

⌨️ 快捷键说明

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