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

📄 traceform.aspx.vb

📁 与房地产相关的各项活动
💻 VB
字号:
'文件名:TraceForm.aspx.vb
Imports System.Data.SqlClient
Imports System.Data
Partial Class ContractManage_TraceForm
    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("D2") > 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 MyDistData() As String = MyValue.Split("、")
            For Each MyString As String In MyDistData
                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 Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        '新增经纪跟进信息
        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.TextBox4.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.TextBox6.Text = Me.GridView1.SelectedRow.Cells(5).Text.ToString()
        Me.TextBox7.Text = Me.GridView1.SelectedRow.Cells(6).Text.ToString()
        Me.DropDownList3.SelectedValue = Me.GridView1.SelectedRow.Cells(7).Text.ToString()
        Me.TextBox9.Text = Me.GridView1.SelectedRow.Cells(8).Text.ToString()
        Me.TextBox10.Text = Me.GridView1.SelectedRow.Cells(9).Text.ToString()
    End Sub
End Class

⌨️ 快捷键说明

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