reportcomplainform.aspx.cs

来自「小区物业管理系统源代码,密码:123456,」· CS 代码 · 共 63 行

CS
63
字号
//文件名:ReportComplainForm.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;

using System.Data.SqlClient;
public partial class ReportManage_ReportComplainForm : System.Web.UI.Page
{
    private static DataTable MyTable = new DataTable();
    protected void Page_Load(object sender, EventArgs e)
    {
        string MyForbidString = Session["MyForbid"].ToString();
        if (MyForbidString.IndexOf("D2") > 1)
        {
            Server.Transfer("~/SystemManage/AllErrorHelp.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {//查询投诉信息
        MyTable.Rows.Clear();
        string MySQL = "Select * FROM 服务投诉 WHERE (投诉日期 BETWEEN '"+this.TextBox1.Text+"' AND '"+this.TextBox2.Text+"') AND (投诉主题 LIKE '%"+this.TextBox3.Text+"%')";
        String MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyCommunityDBConnectionString"].ConnectionString;
        SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);
        MyConnection.Open();
        SqlDataAdapter MyAdatper = new SqlDataAdapter(MySQL, MyConnection);
        MyAdatper.Fill(MyTable);
        this.GridView1.DataSource = MyTable;
        this.GridView1.DataBind();  
    }
    public DataTable MyQueryTable
    {//设置要传递到打印页的数据
        get
        {
            return MyTable;
        }
    }
    public String MyPrintDate
    {//设置要传递到打印页的数据
        get
        {
            return "打印日期:" + DateTime.Now.ToShortDateString() + " 查询条件:开始日期[" +this.TextBox1.Text+ "],结束日期[" + this.TextBox2.Text + "],投诉主题[" +this.TextBox3.Text + "]";
        }
    }
    public String MyPrintTitle
    {//设置要传递到打印页的数据
        get
        {
            return Session["MyCommunityName"].ToString() + "服务投诉信息表";
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {//打印服务投诉信息
        Server.Transfer("~/ReportManage/ReportComplainPrint.aspx");
    }
}

⌨️ 快捷键说明

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