예제 #1
0
 private void btnAceptarExamen_Click(object sender, EventArgs e)
 {
     if (txtIdPacienteExa.Text.Trim().Length == 0 || txtIdDoctorExa.Text.Trim().Length == 0 ||
         rtbObservacionesExamen.Text.Trim().Length == 0 || txtCostoExamen.Text.Trim().Length == 0)
     {
         MessageBox.Show("Rellene todos los datos por favor.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else if (ex.ExamenRegistrado(Convert.ToInt32(txtIdExamen.Text)) == 0)
     {
         ex.InsertarExamen(Convert.ToInt32(txtIdPacienteExa.Text), Convert.ToInt32(txtIdDoctorExa.Text),
                           Convert.ToInt32(txtIdExamen.Text), rtbObservacionesExamen.Text, dtpFechaExamen.Text,
                           Convert.ToSingle(txtCostoExamen.Text));
         LimpiezaExamenTxt();
         ex.CargarPacienteDoctorExamen(dgvTablaExamen);
     }
     else
     {
         MessageBox.Show("No se pudo registrar, el registro ya existe", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }