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

📄 contractform.aspx.vb

📁 与房地产相关的各项活动
💻 VB
字号:
'文件名:ContractForm.aspx.vb
Imports System.Data.SqlClient
Imports System.Data
Partial Class ContractManage_ContractForm
    Inherits System.Web.UI.Page
    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("D3") > 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.DropDownList3.Items.Add(MyString)
            Next
            MySQL = "Select * From 职员信息"
            Dim MyPersonnelTable As New DataTable()
            MyAdapter = New SqlDataAdapter(MySQL, MyConnection)
            MyAdapter.Fill(MyPersonnelTable)
            MyName = "职员姓名"
            MyValue = 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 Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
        '显示合同文件
        Dim MyPath As String = HttpContext.Current.Server.MapPath("~/FileData/") + Me.TextBox18.Text
        System.Diagnostics.Process.Start(MyPath)
    End Sub
    Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        '上传合同文件
        Dim MyFileName As String = Me.FileUpload1.FileName
        Dim MyTargetFile As String = System.IO.Path.Combine(HttpContext.Current.Server.MapPath("~/FileData/"), MyFileName)
        Me.FileUpload1.PostedFile.SaveAs(MyTargetFile)
    End Sub
    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        '新增租售成交信息
        Dim MySQLConnectionString As String = ConfigurationManager.ConnectionStrings("MyHouseDBConnectionString").ConnectionString
        Dim MySQL As String = "Select * From 租售成交 Where (资料类型='" + Me.DropDownList2.Text + "') AND (资料编号='" + Me.TextBox7.Text + "')"
        Dim MyConnection As New SqlConnection(MySQLConnectionString)
        MyConnection.Open()
        Dim MyQueryTable As New DataTable()
        Dim MyAdapter As New SqlDataAdapter(MySQL, MyConnection)
        MyAdapter.Fill(MyQueryTable)
        If (MyQueryTable.Rows.Count > 0) Then
            Return
        End If
        If (MyConnection.State = ConnectionState.Open) Then
            MyConnection.Close()
        End If
        Me.SqlDataSource1.Insert()
    End Sub
    Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
        '修改租售成交信息
        Me.SqlDataSource1.Update()
    End Sub
    Protected Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
        '弹出删除操作确认对话框
        If (e.Row.RowType = DataControlRowType.DataRow) Then
            Dim MyButton As Button = e.Row.FindControl("Button1")
            MyButton.OnClientClick = "return confirm('是否确认删除当前选择的记录?')"
        End If
    End Sub
    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
        '在控件中显示选择的记录
        Me.TextBox20.Text = Me.GridView1.SelectedRow.Cells(2).Text.ToString()
        Me.DropDownList1.SelectedValue = Me.GridView1.SelectedRow.Cells(3).Text.ToString()
        Me.DropDownList2.SelectedValue = Me.GridView1.SelectedRow.Cells(4).Text.ToString()
        Me.TextBox7.Text = Me.GridView1.SelectedRow.Cells(5).Text.ToString()
        Me.TextBox8.Text = Me.GridView1.SelectedRow.Cells(6).Text.ToString()
        Me.TextBox9.Text = Me.GridView1.SelectedRow.Cells(7).Text.ToString()
        Me.TextBox10.Text = Me.GridView1.SelectedRow.Cells(8).Text.ToString()
        Me.DropDownList3.SelectedValue = Me.GridView1.SelectedRow.Cells(9).Text.ToString()
        Me.TextBox12.Text = Me.GridView1.SelectedRow.Cells(10).Text.ToString()
        Me.TextBox13.Text = Me.GridView1.SelectedRow.Cells(11).Text.ToString()
        Me.TextBox14.Text = Me.GridView1.SelectedRow.Cells(12).Text.ToString()
        Me.TextBox15.Text = Me.GridView1.SelectedRow.Cells(13).Text.ToString()
        Me.TextBox16.Text = Me.GridView1.SelectedRow.Cells(14).Text.ToString()
        Me.TextBox17.Text = Me.GridView1.SelectedRow.Cells(15).Text.ToString()
        Me.TextBox18.Text = Me.GridView1.SelectedRow.Cells(16).Text.ToString()
        Me.TextBox19.Text = Me.GridView1.SelectedRow.Cells(17).Text.ToString()
    End Sub
End Class

⌨️ 快捷键说明

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