private void btnGuardar_Click(object sender, EventArgs e) { if (Validar()) { try { clsDetalleHistoria Det = new clsDetalleHistoria(); Det.HistoriaID = Historia.ID; Det.FechaHora = dtiFechaHora.Value; Det.Temperatura = Convert.ToDecimal(diTemp.Value); Det.Peso = Convert.ToDecimal(diPeso.Value); Det.Notas = txtNotas.Text; Det.Tratamientos = txtTratamiento.Text; Det.Fallecimiento = chkFallecio.Checked; if (AdmClin.InsertHistoriaDetalle(Det)) { MessageBox.Show("OCURRENCIA REGISTRADA CORRECTAMENTE", "SGE SYSTEM'S", MessageBoxButtons.OK, MessageBoxIcon.Information); frmHistoriaClinica frm = (frmHistoriaClinica)this.parentForm; frm.CargarOcurrencias(); this.Close(); } else { MessageBox.Show("ERROR AL REGISTRAR LA OCURRENCIA", "SGE SYSTEM'S", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show("ERROR: " + ex.Message, "SGE SYSTEM'S", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }