protected void Page_Load(object sender, EventArgs e)
    {
        tools _tools = new tools();
        SecureQueryString QueryStringSeguro;
        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]);

        Decimal REGISTRO = Convert.ToDecimal(QueryStringSeguro["prueba"]);

        categoriaPruebas _categoriaPruebas = new categoriaPruebas(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaPrueba = _categoriaPruebas.ObtenerSelPruebasPorIdPrueba(Convert.ToInt32(REGISTRO));

        DataRow filaPrueba = tablaPrueba.Rows[0];

        Response.Clear();
        Response.AddHeader("content-disposition", string.Format("attachment;filename={0}", "MANUAL_PRUEBA_" + filaPrueba["ID_PRUEBA"].ToString() + filaPrueba["ARCHIVO_EXTENSION"].ToString().Trim()));

        Response.ContentType = filaPrueba["ARCHIVO_TYPE"].ToString().Trim();

        Response.BinaryWrite((byte[])filaPrueba["ARCHIVO"]);

           Response.End();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        tools             _tools = new tools();
        SecureQueryString QueryStringSeguro;

        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]);

        Decimal REGISTRO = Convert.ToDecimal(QueryStringSeguro["prueba"]);

        categoriaPruebas _categoriaPruebas = new categoriaPruebas(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable        tablaPrueba       = _categoriaPruebas.ObtenerSelPruebasPorIdPrueba(Convert.ToInt32(REGISTRO));

        DataRow filaPrueba = tablaPrueba.Rows[0];

        Response.Clear();
        Response.AddHeader("content-disposition", string.Format("attachment;filename={0}", "MANUAL_PRUEBA_" + filaPrueba["ID_PRUEBA"].ToString() + filaPrueba["ARCHIVO_EXTENSION"].ToString().Trim()));

        Response.ContentType = filaPrueba["ARCHIVO_TYPE"].ToString().Trim();

        Response.BinaryWrite((byte[])filaPrueba["ARCHIVO"]);

        Response.End();
    }
    private void cargar_interfaz_cargar_prueba(Boolean modificar)
    {
        tools _tools = new tools();
        SecureQueryString QueryStringSeguro;
        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]);

        int ID_CATEGORIA = Convert.ToInt32(QueryStringSeguro["categoria"]);
        Decimal ID_PRUEBA = Convert.ToDecimal(QueryStringSeguro["prueba"]);

        categoriaPruebas _categoriaPruebas = new categoriaPruebas(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        DataTable tablaInfoCategoria = new DataTable();

        tablaInfoCategoria = _categoriaPruebas.ObtenerSelCatPruebasPorIdCat(ID_CATEGORIA);

        if (tablaInfoCategoria.Rows.Count <= 0)
        {
            if (_categoriaPruebas.MensajeError == null)
            {
                configurarMensajes(true, System.Drawing.Color.Red);
                Label_MENSAJE.Text = "ADVERETENCIA: No se encontró información sobre la categoría.";
            }
            else
            {
                configurarMensajes(true, System.Drawing.Color.Red);
                Label_MENSAJE.Text = _categoriaPruebas.MensajeError;
            }

            configurarPanelesGenerales(false, false, false, false, false);

            configurarBotonesCategorias(true, false, false, false);
        }
        else
        {
            configurarMensajes(false, System.Drawing.Color.Red);

            DataRow informacionCategoria = tablaInfoCategoria.Rows[0];

            Page.Header.Title = informacionCategoria["NOM_CATEGORIA"].ToString();

            configurarInfoAdicionalModulo(true, "Categoría: " + informacionCategoria["NOM_CATEGORIA"].ToString().Trim());

            cargar_datos_categoria(informacionCategoria);

            Panel_CONTROL_REGISTRO.Visible = true;
            Panel_ID_CATEGORIA.Visible = true;

            Panel_FORMULARIO_CATEGORIAS.Enabled = false;

            configurarBotonesCategorias(false, false, false, false);

            configurarPanelesGenerales(false, true, false, false, false);

            DataTable tablaInfoPrueba = _categoriaPruebas.ObtenerSelPruebasPorIdPrueba(Convert.ToInt32(ID_PRUEBA));

            if (tablaInfoPrueba.Rows.Count <= 0)
            {
                configurarMensajes(true, System.Drawing.Color.Red);
                Label_MENSAJE.Text = "ADVERTENCIA: no se encontró información de la prueba seleccionada." + _categoriaPruebas.MensajeError;

                configurarPanelesGenerales(false, false, false, false, false);
            }
            else
            {
                DataRow filaInfoPrueba = tablaInfoPrueba.Rows[0];

                Panel_PRUEBAS_CONFIGURADAS_ACTUALMENTE.Visible = false;

                cargar_datos_prueba(filaInfoPrueba);

                if (modificar == true)
                {
                    TextBox_NOM_PRUEBA.Enabled = true;
                    TextBox_Comentarios.Enabled = true;

                    Panel_FILEUPLOAD_ARCHIVO.Visible = true;

                    configurarBotonesPruebas(false, true, true);
                }
                else
                {
                    TextBox_NOM_PRUEBA.Enabled = false;
                    TextBox_Comentarios.Enabled = false;

                    Panel_FILEUPLOAD_ARCHIVO.Visible = false;

                    configurarBotonesPruebas(true, false, false);
                }

                configurarMensajes(false, System.Drawing.Color.Red);
                configurarMensajesPruebas(false, System.Drawing.Color.Red);

                configurarPanelesGenerales(false, true, true, false, true);
            }
        }
    }
Beispiel #4
0
    private void cargar_interfaz_cargar_prueba(Boolean modificar)
    {
        tools             _tools = new tools();
        SecureQueryString QueryStringSeguro;

        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]);

        int     ID_CATEGORIA = Convert.ToInt32(QueryStringSeguro["categoria"]);
        Decimal ID_PRUEBA    = Convert.ToDecimal(QueryStringSeguro["prueba"]);

        categoriaPruebas _categoriaPruebas = new categoriaPruebas(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        DataTable tablaInfoCategoria = new DataTable();

        tablaInfoCategoria = _categoriaPruebas.ObtenerSelCatPruebasPorIdCat(ID_CATEGORIA);

        if (tablaInfoCategoria.Rows.Count <= 0)
        {
            if (_categoriaPruebas.MensajeError == null)
            {
                configurarMensajes(true, System.Drawing.Color.Red);
                Label_MENSAJE.Text = "ADVERETENCIA: No se encontró información sobre la categoría.";
            }
            else
            {
                configurarMensajes(true, System.Drawing.Color.Red);
                Label_MENSAJE.Text = _categoriaPruebas.MensajeError;
            }

            configurarPanelesGenerales(false, false, false, false, false);

            configurarBotonesCategorias(true, false, false, false);
        }
        else
        {
            configurarMensajes(false, System.Drawing.Color.Red);

            DataRow informacionCategoria = tablaInfoCategoria.Rows[0];

            Page.Header.Title = informacionCategoria["NOM_CATEGORIA"].ToString();

            configurarInfoAdicionalModulo(true, "Categoría: " + informacionCategoria["NOM_CATEGORIA"].ToString().Trim());

            cargar_datos_categoria(informacionCategoria);

            Panel_CONTROL_REGISTRO.Visible = true;
            Panel_ID_CATEGORIA.Visible     = true;

            Panel_FORMULARIO_CATEGORIAS.Enabled = false;

            configurarBotonesCategorias(false, false, false, false);

            configurarPanelesGenerales(false, true, false, false, false);

            DataTable tablaInfoPrueba = _categoriaPruebas.ObtenerSelPruebasPorIdPrueba(Convert.ToInt32(ID_PRUEBA));

            if (tablaInfoPrueba.Rows.Count <= 0)
            {
                configurarMensajes(true, System.Drawing.Color.Red);
                Label_MENSAJE.Text = "ADVERTENCIA: no se encontró información de la prueba seleccionada." + _categoriaPruebas.MensajeError;

                configurarPanelesGenerales(false, false, false, false, false);
            }
            else
            {
                DataRow filaInfoPrueba = tablaInfoPrueba.Rows[0];

                Panel_PRUEBAS_CONFIGURADAS_ACTUALMENTE.Visible = false;

                cargar_datos_prueba(filaInfoPrueba);

                if (modificar == true)
                {
                    TextBox_NOM_PRUEBA.Enabled  = true;
                    TextBox_Comentarios.Enabled = true;

                    Panel_FILEUPLOAD_ARCHIVO.Visible = true;

                    configurarBotonesPruebas(false, true, true);
                }
                else
                {
                    TextBox_NOM_PRUEBA.Enabled  = false;
                    TextBox_Comentarios.Enabled = false;

                    Panel_FILEUPLOAD_ARCHIVO.Visible = false;

                    configurarBotonesPruebas(true, false, false);
                }

                configurarMensajes(false, System.Drawing.Color.Red);
                configurarMensajesPruebas(false, System.Drawing.Color.Red);

                configurarPanelesGenerales(false, true, true, false, true);
            }
        }
    }