📄 queryhouseleaseform.aspx.vb
字号:
'文件名:QueryHouseLeaseForm.aspx.vb
Imports System.Data.SqlClient
Imports System.Data
Partial Class HouseManage_QueryHouseLeaseForm
Inherits System.Web.UI.Page
Private Shared MySQL As String = ""
'设置要传递到打印页的数据
Public ReadOnly Property MyPrintSQL() As String
Get
Return MySQL
End Get
End Property
'设置要传递到打印页的数据
Public ReadOnly Property MyPrintDate() As String
Get
Return "当前日期:" + DateTime.Now.ToShortDateString() + " 查询条件:所在城区:" + Me.DropDownList1.SelectedValue.ToString() + " 装修级别:" + Me.DropDownList2.SelectedValue.ToString() + " 房型:" + Me.TextBox4.Text + "房至" + Me.TextBox5.Text + "房 建筑面积:" + Me.TextBox6.Text + "至" + Me.TextBox7.Text + "m2 价格:" + Me.TextBox8.Text + "至" + Me.TextBox9.Text + "元"
End Get
End Property
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim MyForbidString As String = Session("MyForbid").ToString()
If (MyForbidString.IndexOf("B4") > 1) Then
Server.Transfer("~/SystemManage/AllErrorHelp.aspx")
End If
If (Not IsPostBack) Then
Dim MySQLConnectionString As String = ConfigurationManager.ConnectionStrings("MyHouseDBConnectionString").ConnectionString
Dim MySQL As String = "Select * From 房源参数 Where 自编号='CQ001'"
Dim MyConnection As New SqlConnection(MySQLConnectionString)
MyConnection.Open()
Dim MyHouseTable As New DataTable()
Dim MyAdapter As New SqlDataAdapter(MySQL, MyConnection)
MyAdapter.Fill(MyHouseTable)
Dim MyName As String = "城区"
Dim MyValue As String = MyHouseTable.Rows(0)(MyName).ToString()
Dim MyPayData() As String = MyValue.Split("、")
For Each MyString As String In MyPayData
Me.DropDownList1.Items.Add(MyString)
Next
MyName = "装修"
MyValue = MyHouseTable.Rows(0)(MyName).ToString()
Dim MyDecData() As String = MyValue.Split("、")
For Each MyString As String In MyDecData
Me.DropDownList2.Items.Add(MyString)
Next
If (MyConnection.State = ConnectionState.Open) Then
MyConnection.Close()
End If
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
'查询可租房源
Dim MyQueryTable As New System.Data.DataTable()
Dim MyConnection As New SqlConnection()
MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("MyHouseDBConnectionString").ConnectionString
MyConnection.Open()
Dim My电梯 As Integer
If (Me.CheckBox1.Checked) Then
My电梯 = 1
Else
My电梯 = 0
End If
MySQL = "SELECT * FROM 可租房源视图 WHERE ('" + Me.TextBox1.Text + "' BETWEEN 委托日期 AND 截止日期) AND (所在城区='" + Me.DropDownList1.SelectedValue.ToString() + "') AND (装修级别='" + Me.DropDownList2.SelectedValue.ToString() + "') AND (电梯=" + My电梯.ToString() + ") AND ( 房 BETWEEN " + Me.TextBox4.Text + " AND " + Me.TextBox5.Text + ") AND (建筑面积 BETWEEN " + Me.TextBox6.Text + " AND " + Me.TextBox7.Text + ") AND (出租价格 BETWEEN " + Me.TextBox8.Text + " AND " + Me.TextBox9.Text + ")"
Dim MyAdapter As New SqlDataAdapter(MySQL, MyConnection)
MyAdapter.Fill(MyQueryTable)
Me.GridView1.DataSource = MyQueryTable
Me.GridView1.DataBind()
If (MyConnection.State = ConnectionState.Open) Then
MyConnection.Close()
End If
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
'打印可租房源
Server.Transfer("~/HouseManage/QueryHouseLeasePrint.aspx")
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -