?? reportownerrepairform.aspx.cs
字號:
?//文件名:ReportOwnerRepairForm.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_ReportOwnerRepairForm : 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("D3") > 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/ReportOwnerRepairPrint.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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -