예제 #1
0
        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);
                }
            }
        }
예제 #2
0
 private void dgvDetalle_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvDetalle.RowCount > 0)
     {
         if (ParentForm != null)
         {
             if (dgvDetalle.CurrentRow != null)
             {
                 if (dgvDetalle.CurrentRow.Cells[10].Value.ToString().Equals("ACTIVO"))
                 {
                     if (ParentForm.Name.Equals("frmHistoriaClinica"))
                     {
                         frmHistoriaClinica frm = (frmHistoriaClinica)this.ParentForm;
                         frm.ObtenerDesdeBuscador(Convert.ToInt32(dgvDetalle.CurrentRow.Cells[0].Value.ToString()));
                         this.Close();
                     }
                 }
                 else
                 {
                     MessageBox.Show("NO PUEDES SELECCIONAR UN PACIENTE QUE SE ENCUENTRA INACTIVO / FALLECIDO", "SGE SYSTEM'S", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
         }
     }
 }