eduinfoform.vb

来自「管理毕业设计的管理系统 VB+SQL2000....」· VB 代码 · 共 44 行

VB
44 行
字号
Public Class EduInfoForm

    Private Sub UpdateInfo(ByVal table As DataTable, ByVal index As Integer)
        TextUser.Text = table.Rows(index)("euser")
        TextName.Text = table.Rows(index)("ename")
        TextEmail.Text = table.Rows(index)("eemail")
        Dim strDuty As String = table.Rows(index)("eduty")
        If strDuty.Substring(0, 1) = "1" Then
            CheckBox1.Checked = True
        End If
        If strDuty.Substring(1, 1) = "1" Then
            CheckBox2.Checked = True
        End If
        If strDuty.Substring(2, 1) = "1" Then
            CheckBox3.Checked = True
        End If
    End Sub

    Private Sub EduInfoForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim strUser As String = LoginForm.TextUser.Text
        Dim strSQL As String = "select * from edu where euser='" + strUser + "'"
        Dim UserTable As DataTable = DBOperation.Search(strSQL)

        UpdateInfo(UserTable, 0)
    End Sub

    Private Sub ButtonOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonOK.Click
        '
        '请加入判断输入的规范!!!!!!
        '
        Dim strSQL As String = "update edu set eemail='" + Trim(TextEmail.Text) + "' where euser='" + TextUser.Text + "'"
        '更新个人信息
        If DBOperation.Update(strSQL) Then
            MsgBox("更新用户信息成功!", MsgBoxStyle.OkOnly, "更新用户")
        Else
            MsgBox("更新用户信息失败!", MsgBoxStyle.Exclamation, "更新用户")
        End If
        Me.Close()
    End Sub

    Private Sub ButtonCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCancel.Click
        Me.Close()
    End Sub
End Class

⌨️ 快捷键说明

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