Good evening I have a problem registering a form of a dating system in which marks the error of the title, I think the solution would be to convert the following code.
Private Sub BtnRegistrar_Click(sender As Object, e As EventArgs) Handles BtnRegistrar.Click
If Me.ValidateChildren = True And TxtDescripcion.Text <> "" And cmbpacientes.Text <> "" And cmbagendo.Text <> "" And cmbespecialistas.Text <> "" Then
Try
reg.descripcion = TxtDescripcion.Text
reg.FechaCITA = Convert.ToDateTime(Calendario.Value)
reg.paciente = cmbpacientes.Text
If cmbpacientes.SelectedItem = "Enfermito1" Then
reg.paciente = "Enfermito1"
ElseIf cmbpacientes.SelectedItem = "Enfermito2" Then
reg.paciente = "Enfermito2"
End If
If cmbagendo.SelectedItem = "Recepcionista1" Then
reg.agendo = "Recepcionista1"
ElseIf cmbagendo.SelectedItem = "Recepcionista2" Then
reg.agendo = "Recepcionista2"
End If
If cmbespecialistas.SelectedItem = "Simi" Then
reg.especialista = "Simi"
ElseIf cmbespecialistas.SelectedItem = "LatinLover" Then
reg.especialista = "LatinLover"
End If
If func.REGISTRAR_CITA(reg) Then
MessageBox.Show("Cita registrada correctamente", "Guardando cita")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Debe llenar todos los campos", "Guardando cita", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
Any comments are valid to be able to finish this catalog:)