private void btnEliminar_Click(object sender, EventArgs e) { objHistoriaClinicaD = new clHistoriaClinicaD(); objHistoriaClinicaL = new clHistoriaClinicaL(); objHistoriaClinicaE = new clHistoriaClinicaE(); objHistoriaClinicaE.NoHistoriaClinica = txtNoHistoriaClinica.Text; clHistoriaClinicaE objHistoriaE = new clHistoriaClinicaE(); objHistoriaE = objHistoriaClinicaD.mtdIdHC(objHistoriaClinicaE); // idHC = objHistoriaE.IdHistoriaClinica; String lim = ""; //clHistoriaClinicaE eidHC = new clHistoriaClinicaE(); //eidHC.NoHistoriaClinica = txtNoHistoriaClinica.Text; //clHistoriaClinicaE objHistoria = new clHistoriaClinicaE(); //objHistoria = objHistoriaClinicaD.mtdIdHC(objHistoriaClinicaE); mtdCargar(); int eliminarValores = objHistoriaClinicaL.mtdEliminarValores(vecDatos, objHistoriaE); if (eliminarValores != 0) { MessageBox.Show("Valores eliminados con exito"); } else { MessageBox.Show("Error al eliminar Valores de Historia Clinica"); //validacion.BorrarCampos(groupBox2, groupBox3, groupBox4, groupBox5, groupBox6, groupBox7, groupBox8 // , groupBox9, groupBox10, groupBox11, groupBox12, groupBox13, groupBox14, groupBox15, groupBox16, groupBox17, groupBox18); //txtLensometriaOD.Text = lim; txtLensometriaOI.Text = lim; //txtPHOD.Text = lim; txtPHOI.Text = lim; txtReflejosPupilares.Text = lim; //txtCovertTestVL.Text = lim; txtCovertTestVP.Text = lim; txtCovertTestPPC.Text = lim; //txtDuccionesOD.Text = lim; txtDuccionesOI.Text = lim; } objHistoriaClinicaE.NoHistoriaClinica = txtNoHistoriaClinica.Text; objHistoriaClinicaE.Fecha = DateTime.Parse(dtpFecha.Text); objHistoriaClinicaE.Hora = txtHora.Text; objHistoriaClinicaE.IdPaciente = int.Parse(IdPaciente.ToString()); objHistoriaClinicaE.UltimoControl = txtUltimoControl.Text; objHistoriaClinicaE.RX = txtRX.Text; objHistoriaClinicaE.MotivoCOnsulta = txtMotivoConsulta.Text; objHistoriaClinicaE.Antecedentes = txtAntecedentes.Text; objHistoriaClinicaE.ExamenEsterno = txtExamenExterno.Text; objHistoriaClinicaE.ReflejosPupilares = txtReflejosPupilares.Text; objHistoriaClinicaE.BioMicroscopia = txtBiomicroscopia.Text; objHistoriaClinicaE.Diagnostico = txtDiagnostico.Text; objHistoriaClinicaE.Tratamiento = txtTratamiento.Text; objHistoriaClinicaE.Observaciones = txtObservaciones.Text; objHistoriaClinicaE.IdHistoriaClinica = objHistoriaE.IdHistoriaClinica; int eliminarHC = objHistoriaClinicaL.mtdEliminarHC(objHistoriaClinicaE); if (eliminarHC == 0) { MessageBox.Show("Error al eliminar."); } else { DialogResult result = MessageBox.Show("¿Deseas eliminar la Historia Clinica?", "Eliminar", MessageBoxButtons.YesNoCancel); if (result == DialogResult.Yes) { MessageBox.Show("Historia Clinica Eliminada con exito."); validacion = new clValidaciones(); validacion.BorrarCampos(groupBox2, groupBox3, groupBox4, groupBox5, groupBox6, groupBox7, groupBox8 , groupBox9, groupBox10, groupBox11, groupBox12, groupBox13, groupBox14, groupBox15, groupBox16, groupBox17, groupBox18); txtLensometriaOD.Text = lim; txtLensometriaOI.Text = lim; txtPHOD.Text = lim; txtPHOI.Text = lim; txtReflejosPupilares.Text = lim; txtCovertTestVL.Text = lim; txtCovertTestVP.Text = lim; txtCovertTestPPC.Text = lim; txtDuccionesOD.Text = lim; txtDuccionesOI.Text = lim; } } }