📄 querysaleform.aspx.cs
字号:
//文件名:QuerySaleForm.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 ContractManage_QuerySaleForm : System.Web.UI.Page
{
private static string MySQL = "";
protected void Page_Load(object sender, EventArgs e)
{
string MyForbidString = Session["MyForbid"].ToString();
if (MyForbidString.IndexOf("D4") > 1)
{
Server.Transfer("~/SystemManage/AllErrorHelp.aspx");
}
if (!IsPostBack)
{
String MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyHouseDBConnectionString"].ConnectionString;
SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);
MyConnection.Open();
string MySQL = "Select * From 职员信息";
DataTable MyPersonnelTable = new DataTable();
SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);
MyAdapter.Fill(MyPersonnelTable);
string MyName = "职员姓名";
string MyValue = MyPersonnelTable.Rows[0][MyName].ToString();
foreach (DataRow MyRow in MyPersonnelTable.Rows)
{
this.DropDownList1.Items.Add(MyRow[MyName].ToString());
}
if (MyConnection.State == ConnectionState.Open)
{
MyConnection.Close();
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{//查询售房信息
DataTable MyQueryTable = new System.Data.DataTable();
SqlConnection MyConnection = new SqlConnection();
MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings["MyHouseDBConnectionString"].ConnectionString;
MyConnection.Open();
MySQL = "SELECT * FROM 租售成交 WHERE ((资料类型='出售房源') OR (资料类型='求购客源')) AND ( 成交日期 BETWEEN '" +
this.TextBox1.Text + "' AND '" + this.TextBox2.Text + "') AND (合同编号 LIKE '%" + this.TextBox3.Text +
"%') AND (资料编号 LIKE '%" + this.TextBox4.Text + "%') AND (经办人员='" + this.DropDownList1.SelectedValue.ToString() + "')";
SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);
MyAdapter.Fill(MyQueryTable);
this.GridView1.DataSource = MyQueryTable;
this.GridView1.DataBind();
if (MyConnection.State == ConnectionState.Open)
{
MyConnection.Close();
}
}
public string MyPrintSQL
{//设置要传递到打印页的数据
get
{
return MySQL;
}
}
public String MyPrintDate
{//设置要传递到打印页的数据
get
{
return "当前日期:" + DateTime.Now.ToShortDateString() + " 经办人员:" + this.DropDownList1.SelectedValue.ToString();
}
}
protected void Button2_Click(object sender, EventArgs e)
{//打印售房信息
Server.Transfer("~/ContractManage/QuerySalePrint.aspx");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -