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

📄 form3.vb

📁 奖学金评定系统
💻 VB
📖 第 1 页 / 共 4 页
字号:
        '
        'Label17
        '
        Me.Label17.Location = New System.Drawing.Point(8, 128)
        Me.Label17.Name = "Label17"
        Me.Label17.Size = New System.Drawing.Size(72, 16)
        Me.Label17.TabIndex = 3
        Me.Label17.Text = "奖励原因:"
        '
        'Label16
        '
        Me.Label16.Location = New System.Drawing.Point(8, 80)
        Me.Label16.Name = "Label16"
        Me.Label16.Size = New System.Drawing.Size(72, 16)
        Me.Label16.TabIndex = 2
        Me.Label16.Text = "所获奖励:"
        '
        'Label15
        '
        Me.Label15.Location = New System.Drawing.Point(248, 32)
        Me.Label15.Name = "Label15"
        Me.Label15.Size = New System.Drawing.Size(72, 16)
        Me.Label15.TabIndex = 1
        Me.Label15.Text = "姓    名:"
        '
        'Label14
        '
        Me.Label14.Location = New System.Drawing.Point(8, 32)
        Me.Label14.Name = "Label14"
        Me.Label14.Size = New System.Drawing.Size(72, 16)
        Me.Label14.TabIndex = 0
        Me.Label14.Text = "学    号:"
        '
        'Form3
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(496, 393)
        Me.Controls.Add(Me.TabControl1)
        Me.Menu = Me.MainMenu1
        Me.Name = "Form3"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "添加学生信息"
        Me.TabControl1.ResumeLayout(False)
        Me.TabPage1.ResumeLayout(False)
        Me.TabPage2.ResumeLayout(False)
        Me.GroupBox2.ResumeLayout(False)
        Me.GroupBox1.ResumeLayout(False)
        Me.TabPage3.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub MenuItem23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem23.Click
        MsgBox("作者:李莹   软件学院03-8班", MsgBoxStyle.ApplicationModal, "学籍管理系统")
    End Sub

    Private Sub MenuItem24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem24.Click
        Dim newform1 As New Form1
        newform1.Show()
        Me.Hide()
    End Sub

    Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
        Dim newform11 As New Form11
        newform11.Show()
    End Sub

    Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
        Dim newform10 As New Form10
        newform10.Show()
    End Sub

    Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem6.Click
        Me.Dispose()
    End Sub

    Private Sub MenuItem10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem10.Click
        Dim newform4 As New Form4
        newform4.Show()
    End Sub

    Private Sub MenuItem11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem11.Click
        Dim newform5 As New Form5
        newform5.Show()
    End Sub

    Private Sub MenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim newform8 As New Form8
        newform8.Show()
    End Sub

    Private Sub MenuItem14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem14.Click
        Dim newform6 As New Form6
        newform6.Show()
    End Sub

  

   



    Private Sub MenuItem19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem19.Click
        Dim newform9 As New Form9
        newform9.Show()
    End Sub

  

    Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not RadioButton1.Checked And Not RadioButton2.Checked Then

            MsgBox("请选择性别!", vbOKOnly + vbExclamation, "警告")
            Exit Sub
        End If

        If Not CheckBox1.Checked And Not CheckBox2.Checked Then

            MsgBox("请选择政治面貌!", vbOKOnly + vbExclamation, "警告")
            Exit Sub
        End If

        If TextBox1.Text = "" Then
            MsgBox("请输入学号!", vbOKOnly + vbExclamation, "警告")
            Exit Sub
        End If

        If TextBox2.Text = "" Then
            MsgBox("请输入姓名!", vbOKOnly + vbExclamation, "警告")
            Exit Sub
        End If

        Dim tablename As String = "student"
        SearchSQL = "select * from student"
        Module1.ExecuteSQL(SearchSQL, tablename)
        Dim newrow As DataRow
        newrow = Module1.mytable.NewRow
        newrow.Item(0) = Trim(TextBox1.Text)

        newrow.Item(1) = Trim(TextBox2.Text)

        If RadioButton1.Checked Then
            newrow.Item(2) = Trim(RadioButton1.Text)
        Else
            newrow.Item(2) = Trim(RadioButton2.Text)
        End If
        newrow.Item(3) = Trim((ComboBox1.Text) + (Label9.Text) + (ComboBox2.Text) + (Label10.Text) + (ComboBox3.Text))

        newrow.Item(4) = Trim(ComboBox4.Text)
        If CheckBox1.Checked Then
            newrow.Item(5) = Trim(CheckBox1.Text)
        Else
            newrow.Item(5) = Trim(CheckBox2.Text)
        End If
        newrow.Item(6) = Trim(TextBox3.Text)
        newrow.Item(7) = Trim(TextBox4.Text)
        mytable.Rows.Add(newrow)    '添加新记录
        Module1.cmd = New SqlCommandBuilder(Module1.ADOcmd)
        '使用自动生成的SQL语句

        Try
            Module1.ADOcmd.Update(Module1.ds, "student")
            '对数据库进行更新
            MsgBox("添加同学信息成功!", vbOKOnly + vbExclamation, "警告")
        Catch
            MsgBox(Err.Description)
        End Try

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Dim newform3 As New Form3
        newform3.Show()
        Me.Hide()

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If TextBox12.Text = "" Or TextBox13.Text = "" Then

            MsgBox("请输入学号和姓名!", vbOKOnly + vbExclamation, "警告")
            Exit Sub
        End If
        Dim tablename As String = "result"
        SearchSQL = "select * from result"
        Module1.ExecuteSQL(SearchSQL, tablename)
        Dim newrow As DataRow
        newrow = Module1.mytable.NewRow
        newrow.Item(0) = Trim(TextBox12.Text)
        newrow.Item(1) = Trim(TextBox13.Text)
        newrow.Item(2) = Trim(TextBox14.Text)
        newrow.Item(3) = Trim(TextBox15.Text)
        newrow.Item(4) = Trim(TextBox16.Text)
        newrow.Item(5) = Trim(TextBox17.Text)
        newrow.Item(6) = Trim(TextBox18.Text)
        newrow.Item(7) = Trim(TextBox19.Text)
        newrow.Item(8) = Trim(TextBox20.Text)
        mytable.Rows.Add(newrow)    '添加新记录
        Module1.cmd = New SqlCommandBuilder(Module1.ADOcmd)
        '使用自动生成的SQL语句

        Try
            Module1.ADOcmd.Update(Module1.ds, "result")
            '对数据库进行更新
            MsgBox("添加成绩信息成功!", vbOKOnly + vbExclamation, "警告")
        Catch
            MsgBox(Err.Description)
        End Try
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        TextBox5.Text = ""
        TextBox6.Text = ""
        TextBox7.Text = ""
        TextBox8.Text = ""
        TextBox9.Text = ""
        TextBox10.Text = ""
        TextBox11.Text = ""

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        TextBox12.Text = ""
        TextBox13.Text = ""
        TextBox14.Text = ""
        TextBox15.Text = ""
        TextBox9.Text = ""
        TextBox16.Text = ""
        TextBox17.Text = ""
        TextBox18.Text = ""
        TextBox19.Text = ""
        TextBox20.Text = ""

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        If TextBox5.Text = "" Then

            MsgBox("请输入学号!", vbOKOnly + vbExclamation, "警告")
            Exit Sub
        End If
        If TextBox6.Text = "" Then

            MsgBox("请输入姓名!", vbOKOnly + vbExclamation, "警告")
            Exit Sub
        End If

        Dim tablename As String = "jc"
        SearchSQL = "select * from jc"
        Module1.ExecuteSQL(SearchSQL, tablename)
        Dim newrow As DataRow
        newrow = Module1.mytable.NewRow
        newrow.Item(0) = Trim(TextBox5.Text)
        newrow.Item(1) = Trim(TextBox6.Text)
        newrow.Item(2) = Trim(TextBox7.Text)
        newrow.Item(3) = Trim(TextBox8.Text)
        newrow.Item(4) = Trim(TextBox9.Text)
        newrow.Item(5) = Trim(TextBox10.Text)
        newrow.Item(6) = Trim(TextBox11.Text)

        mytable.Rows.Add(newrow)    '添加新记录
        Module1.cmd = New SqlCommandBuilder(Module1.ADOcmd)
        '使用自动生成的SQL语句

        Try
            Module1.ADOcmd.Update(Module1.ds, "jc")
            '对数据库进行更新
            MsgBox("添加成绩信息成功!", vbOKOnly + vbExclamation, "警告")
        Catch
            MsgBox(Err.Description)
        End Try
    End Sub

    Private Sub MenuItem18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem18.Click
        Dim newform8 As New Form8
        newform8.Show()

    End Sub

    Private Sub TabPage1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage1.Click

    End Sub
    Private Sub ShowData()
        myrow = Module1.mytable.Rows.Item(rownumber)



    End Sub
    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim tablename As String
        tablename = "student"
        SearchSQL = "select * from student"
        Module1.ExecuteSQL(SearchSQL, "student")
        ShowData()
        TextBox22.Text = Module1.mytable.Rows.Count
        TextBox22.Show()

        
        SearchSQL = "select * from result"
        Module1.ExecuteSQL(SearchSQL, "result")
        ShowData()
        TextBox21.Text = Module1.mytable.Rows.Count
        TextBox21.Show()


        
        SearchSQL = "select * from jc"
        Module1.ExecuteSQL(SearchSQL, "jc")
        ShowData()
        TextBox23.Text = Module1.mytable.Rows.Count
        TextBox23.Show()

    End Sub

    Private Sub MenuItem15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem15.Click
        Dim newform7 As New Form7
        newform7.Show()

    End Sub

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged

    End Sub
End Class

⌨️ 快捷键说明

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