?? reportownerform.aspx.cs
字號:
?//文件名:ReportOwnerForm.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_ReportOwnerForm : 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("D1") > 1)
{
Server.Transfer("~/SystemManage/AllErrorHelp.aspx");
}
}
protected void Button1_Click(object sender, EventArgs e)
{//查詢業(yè)主信息
MyTable.Rows.Clear();
string MySQL = "Select * FROM 業(yè)主信息 WHERE (業(yè)主編號 NOT IN (Select 業(yè)主編號 FROM 遷出信息)) ";
if (this.DropDownList1.SelectedValue == "全部")
MySQL += "";
else
MySQL += " AND (樓棟名稱='" + this.DropDownList1.SelectedValue + "')";
MySQL += " AND (單元名稱 LIKE '%" + this.TextBox1.Text + "%')";
if (this.DropDownList2.SelectedValue == "全部")
MySQL += "";
else
MySQL += " AND (房屋性質(zhì)='" + this.DropDownList2.SelectedValue + "')";
MySQL += " AND (房屋類型 LIKE '%" + this.TextBox2.Text + "%')";
MySQL += " AND (常住人員 LIKE '%" + this.TextBox3.Text + "%')";
if (this.DropDownList3.SelectedValue == "全部")
MySQL += "";
else
MySQL += " AND (當(dāng)前狀態(tài)='" + this.DropDownList3.SelectedValue + "')";
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
{//設(shè)置要傳遞到打印頁的數(shù)據(jù)
get
{
return MyTable;
}
}
public String MyPrintDate
{//設(shè)置要傳遞到打印頁的數(shù)據(jù)
get
{
return "打印日期:" + DateTime.Now.ToShortDateString() + " 查詢條件:樓棟名稱[" + this.DropDownList1.SelectedValue + "],單元名稱[" +this.TextBox1.Text + "],房屋性質(zhì)[" + this.DropDownList2.SelectedValue + "],房屋類型[" + this.TextBox2.Text + "],常住人員[" +this.TextBox3.Text + "],當(dāng)前狀態(tài)["+this.DropDownList3.SelectedValue+"]";
}
}
public String MyPrintTitle
{//設(shè)置要傳遞到打印頁的數(shù)據(jù)
get
{
return Session["MyCommunityName"].ToString() + "業(yè)主信息表";
}
}
protected void Button2_Click(object sender, EventArgs e)
{//打印小區(qū)業(yè)主信息
Server.Transfer("~/ReportManage/ReportOwnerPrint.aspx");
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -