Example #1
0
 public ClsDiagnosticoVIH seleccionarPorId(int idDiagnosticoVIH)
 {
     try
     {
         ClsDiagnosticoVIH r  = new ClsDiagnosticoVIH();
         DataTable         dt = new DataTable();
         dt = db.dataTableSP("SPSDiagnosticoVIHPorID", null, db.parametro("@PidDiagnosticoVIH", idDiagnosticoVIH));
         if (dt.Rows.Count > 0)
         {
             r.idDiagnosticoVIH      = clsHelper.valI(dt.Rows[0]["idDiagnosticoVIH"].ToString());
             r.idPaciente            = clsHelper.valI(dt.Rows[0]["idPaciente"].ToString());
             r.fechaDiagnostico      = clsHelper.valDate(dt.Rows[0]["fechaDiagnostico"].ToString());
             r.edadAnos              = clsHelper.valI(dt.Rows[0]["edadAnos"].ToString());
             r.edadMeses             = clsHelper.valI(dt.Rows[0]["edadMeses"].ToString());
             r.edadDias              = clsHelper.valI(dt.Rows[0]["edadDias"].ToString());
             r.idrangoEdad           = clsHelper.valI(dt.Rows[0]["idrangoEdad"].ToString());
             r.idGrupoTransmision    = clsHelper.valI(dt.Rows[0]["idGrupoTransmision"].ToString());
             r.idMotivoPrueba        = clsHelper.valI(dt.Rows[0]["idMotivoPrueba"].ToString());
             r.anticuerpos           = clsHelper.valB(dt.Rows[0]["anticuerpos"].ToString());
             r.valorAnticuerpos      = dt.Rows[0]["valorAnticuerpos"].ToString();
             r.DNAProviral           = clsHelper.valB(dt.Rows[0]["DNAProviral"].ToString());
             r.valorDNAProviral      = dt.Rows[0]["valorDNAProviral"].ToString();
             r.vihCargaViralRNA      = clsHelper.valB(dt.Rows[0]["vihCargaViralRNA"].ToString());
             r.valorVihCargaViralRNA = dt.Rows[0]["valorVihCargaViralRNA"].ToString();
             r.CV           = dt.Rows[0]["CV"].ToString();
             r.VIHCVLOG10   = dt.Rows[0]["VIHCVLOG10"].ToString();
             r.idTipoPrueba = clsHelper.valI(dt.Rows[0]["idTipoPrueba"].ToString());
         }
         return(r);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #2
0
 void cargarDatosExistentes()
 {
     try
     {
         ClsDiagnosticoVIH d  = new ClsDiagnosticoVIH();
         DataTable         dt = new DataTable();
         dt = d.seleccionarTodos(int.Parse(Session["idPaciente"].ToString()));
         grdExistentes.DataSource = dt;
         grdExistentes.DataBind();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #3
0
    protected void lnkModificar_Click(object sender, EventArgs e)
    {
        try
        {
            if (!(Boolean)ViewState["actualizar"])
            {
                Response.Redirect("../Default.aspx");
            }
            GridViewRow gr = (GridViewRow)((Control)sender).Parent.Parent;
            int         idDiagnosticoVIH;
            idDiagnosticoVIH = int.Parse(((Label)gr.FindControl("lblIdDiagnosticoVIH")).Text);
            ClsDiagnosticoVIH d = new ClsDiagnosticoVIH();
            d = d.seleccionarPorId(idDiagnosticoVIH);
            if (d.idDiagnosticoVIH != null)
            {
                ViewState["idDiagnosticoVIH"] = d.idDiagnosticoVIH;
                txtFechaDiagnóstico.Text      = clsHelper.dateFormat(d.fechaDiagnostico.ToString());
                txtEdadAnos.Text = d.edadAnos.ToString();
                txtEdadMes.Text  = d.edadMeses.ToString();
                txtEdadDias.Text = d.edadDias.ToString();
                cargarMotivoPruebaRangoEdad();
                cboRangoEdad.SelectedValue        = d.idrangoEdad.ToString();
                cboGrupoTransmision.SelectedValue = d.idGrupoTransmision.ToString();
                cboMotivoDeLaPrueba.SelectedValue = d.idMotivoPrueba.ToString();
                chkAnticuerpos.Checked            = (bool)d.anticuerpos;
                chkDNAProviral.Checked            = (bool)d.DNAProviral;
                chkVIHCargaViralRNA.Checked       = (bool)d.vihCargaViralRNA;
                txtAnticuerpos.Text      = d.valorAnticuerpos;
                txtDnaProviral.Text      = d.valorDNAProviral;
                txtVIHCargaViralRNA.Text = d.valorVihCargaViralRNA;
                txtCV.Text = d.CV;
                txtVIHCargarViralLog10.Text = d.VIHCVLOG10;
                cboTipoPrueba.SelectedValue = d.idTipoPrueba.ToString();

                txtAnticuerpos.Enabled         = chkAnticuerpos.Checked;
                txtDnaProviral.Enabled         = chkDNAProviral.Checked;
                txtVIHCargaViralRNA.Enabled    = chkVIHCargaViralRNA.Checked;
                txtVIHCargarViralLog10.Enabled = chkVIHCargaViralRNA.Checked;
                txtCV.Enabled = chkVIHCargaViralRNA.Checked;
            }
        }

        catch (Exception ex)
        {
            clsHelper.mostrarError("lnkModificar_Click", ex, this, true);
        }
    }
Example #4
0
    protected void lnkGuardar_Click(object sender, EventArgs e)
    {
        try
        {
            if (!(Boolean)ViewState["crear"])
            {
                Response.Redirect("../Default.aspx");
            }

            if (string.IsNullOrEmpty(txtFechaDiagnóstico.Text))
            {
                clsHelper.mensaje("Ingrese una fecha", this, clsHelper.tipoMensaje.alerta);
                return;
            }

            if (!clsHelper.isDate(txtFechaDiagnóstico.Text))
            {
                clsHelper.mensaje("Ingrese una fecha válida", this, clsHelper.tipoMensaje.alerta);
                return;
            }
            //

            ClsDiagnosticoVIH d = new ClsDiagnosticoVIH();
            if (ViewState["idDiagnosticoVIH"] != null)
            {
                d.idDiagnosticoVIH = int.Parse(ViewState["idDiagnosticoVIH"].ToString());
            }
            else
            {
                d.idDiagnosticoVIH = null;
            }
            if (Session["idPaciente"] != null)
            {
                d.idPaciente = int.Parse(Session["idPaciente"].ToString());
            }
            else
            {
                clsHelper.mensaje("Por favor reinicie la aplicación", this, clsHelper.tipoMensaje.msgbx);
                return;
            }

            //recolecta datos

            d.fechaDiagnostico      = clsHelper.valDate(txtFechaDiagnóstico.Text);
            d.edadAnos              = clsHelper.valI(txtEdadAnos.Text);
            d.edadMeses             = clsHelper.valI(txtEdadMes.Text);
            d.edadDias              = clsHelper.valI(txtEdadDias.Text);
            d.idrangoEdad           = clsHelper.getValueI(cboRangoEdad);
            d.idGrupoTransmision    = clsHelper.getValueI(cboGrupoTransmision);
            d.idMotivoPrueba        = clsHelper.getValueI(cboMotivoDeLaPrueba);
            d.anticuerpos           = clsHelper.valB(chkAnticuerpos.Checked.ToString());
            d.valorAnticuerpos      = txtAnticuerpos.Text;
            d.DNAProviral           = clsHelper.valB(chkDNAProviral.Checked.ToString());
            d.valorDNAProviral      = txtDnaProviral.Text;
            d.vihCargaViralRNA      = clsHelper.valB(chkVIHCargaViralRNA.Checked.ToString());
            d.valorVihCargaViralRNA = txtVIHCargaViralRNA.Text;
            d.CV           = txtCV.Text;
            d.VIHCVLOG10   = txtVIHCargarViralLog10.Text;
            d.idTipoPrueba = clsHelper.getValueI(cboTipoPrueba);
            d.usuario      = Session["usuario"].ToString();
            d.grabar();
            limpiar();
            clsHelper.mensaje("Proceso exitoso", this, clsHelper.tipoMensaje.informacion, true);
            cargarDatosExistentes();
        }
        catch (Exception ex)
        {
            clsHelper.mostrarError("lnkGuardar_Click", ex, this, true);
        }
    }