⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 queryleaseform.aspx.vb

📁 与房地产相关的各项活动
💻 VB
字号:
'文件名:QueryLeaseForm.aspx.vb
Imports System.Data.SqlClient
Imports System.Data
Partial Class ContractManage_QueryLeaseForm
    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()
        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("D5") > 1) Then
            Server.Transfer("~/SystemManage/AllErrorHelp.aspx")
        End If
        If (Not IsPostBack) Then
            Dim MySQLConnectionString As String = ConfigurationManager.ConnectionStrings("MyHouseDBConnectionString").ConnectionString
            Dim MyConnection As New SqlConnection(MySQLConnectionString)
            MyConnection.Open()
            Dim MySQL As String = "Select * From 职员信息"
            Dim MyPersonnelTable As New DataTable()
            Dim MyAdapter As New SqlDataAdapter(MySQL, MyConnection)
            MyAdapter.Fill(MyPersonnelTable)
            Dim MyName As String = "职员姓名"
            Dim MyValue As String = MyPersonnelTable.Rows(0)(MyName).ToString()
            For Each MyRow As DataRow In MyPersonnelTable.Rows
                Me.DropDownList1.Items.Add(MyRow(MyName).ToString())
            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()
        MySQL = "SELECT * FROM 租售成交 WHERE ((资料类型='出租房源') OR (资料类型='求租客源')) AND ( 成交日期 BETWEEN '" + Me.TextBox1.Text + "' AND '" + Me.TextBox2.Text + "') AND (合同编号 LIKE '%" + Me.TextBox3.Text + "%') AND (资料编号 LIKE '%" + Me.TextBox4.Text + "%') AND (经办人员='" + Me.DropDownList1.SelectedValue.ToString() + "')"
        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("~/ContractManage/QueryLeasePrint.aspx")
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -