reportcommonrepairform.aspx.cs
来自「小区物业管理系统源代码,密码:123456,」· CS 代码 · 共 63 行
CS
63 行
//文件名:ReportCommonRepairForm.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_ReportCommonRepairForm : 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("D4") > 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();
}
protected void Button2_Click(object sender, EventArgs e)
{//打印公共维修信息
Server.Transfer("~/ReportManage/ReportCommonRepairPrint.aspx");
}
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() + "公共维修情况表";
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?