Public Class frmModifyStudent
    Private Sub btnClosed_Click(sender As Object, e As EventArgs) Handles btnClosed.Click
        Me.Close()
    End Sub

    Private Sub txtStudentId_TextChanged(sender As Object, e As EventArgs) Handles txtStudentId.TextChanged
        Try
            If Not IsNumeric(txtStudentId.Text) Then
                txtStudentId.Clear()
            Else
                StudentTxtFill(Me)
            End If
        Catch ex As Exception
            ' MsgBox(ex.Message & " txtStudentId_TextChanged", MsgBoxStyle.Exclamation)
        End Try
    End Sub

    Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
        If rdoMale.Checked = True Then
            radioSEX = "MALE"
        Else
            radioSEX = "FEMALE"
        End If
        checkOption(chkBirthCert, Nyesno)
        checkOption(chkCertification, Cyesno)
        checkOption(chkPic, Pyesno)
        checkOption(chkReportCard, Ryesno)
        'students siblings

        'student(requirements)
        sql = "UPDATE  `tblrequirements` SET `NSO`='" & Nyesno & "', `PICID`='" & Pyesno & "', `REPORTCARD`='" & Ryesno _
                & "', `CERTIFICATE_OF_TRANSFER`='" & Cyesno & "' WHERE IDNO='" & txtStudentId.Text & "'"
        edit(sql)
        'student basic info
        sql = "UPDATE tblstudent SET   `FNAME`='" & txtFName.Text & "', `LNAME`='" & txtLName.Text & "', `MNAME`='" & txtMName.Text _
                & "', `SEX`='" & radioSEX & "', `BDAY`='" & dtpDbirth.Text & "', `BPLACE`='" & txtPBirth.Text & "', `AGE`='" & txtAge.Text _
                & "', `HOME_ADD`='" & txtAddress.Text & "',GUARDIAN='" & txtguardian.Text & "',GUARDIAN_ADD ='" & txtguardianadd.Text _
                & "',GUARDIAN_TEL ='" & txtguardiantel.Text & "',`LASTSCHOOLATTEND`='" & txtLastSchoolAttend.Text _
                & "', WEIGTH='" & txtWeigth.Text & "',HEIGTH='" & txtHeight.Text & "' WHERE IDNO='" & txtStudentId.Text & "'"
        messageTrue = "Student has been updated."
        messageFalse = "No student's record for this id. No record to be updated."
        CreateUpdateDeleteAllMessage(sql, messageTrue, messageFalse)
    End Sub

    Private Sub txtLName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtLName.TextChanged
        Try
            If IsNumeric(txtLName.Text) Then
                txtLName.Clear()
            End If
        Catch ex As Exception

        End Try
    End Sub

    Private Sub txtFName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtFName.TextChanged
        Try
            If IsNumeric(txtFName.Text) Then
                txtFName.Clear()
            End If
        Catch ex As Exception

        End Try
    End Sub

    Private Sub txtMName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtMName.TextChanged
        Try
            If IsNumeric(txtMName.Text) Then
                txtMName.Clear()
            End If
        Catch ex As Exception

        End Try
    End Sub

    Private Sub txtAge_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtAge.TextChanged
        Try
            If Not IsNumeric(txtAge.Text) Then
                txtAge.Clear()
            End If
        Catch ex As Exception

        End Try

    End Sub

    Private Sub txtWeigth_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtWeigth.TextChanged

        Try
            If Not Double.Parse(IsNumeric(txtWeigth.Text)) Then
                txtWeigth.Clear()
            End If
        Catch ex As Exception

        End Try

    End Sub

    Private Sub txtHeight_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtHeight.TextChanged
        Try
            If Not Double.Parse(IsNumeric(txtHeight.Text)) Then
                txtHeight.Clear()
            End If
        Catch ex As Exception

        End Try

    End Sub

End Class