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_nueva_prueba() { 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); TextBox_ID_PRUEBA.Text = ""; Panel_ID_PRUEBA.Visible = false; Panel_ARCHIVO_ACTUAL.Visible = false; configurarPanelesGenerales(false, true, true, false, true); configurarMensajes(false, System.Drawing.Color.Red); configurarMensajesPruebas(false, System.Drawing.Color.Red); Panel_PRUEBAS_CONFIGURADAS_ACTUALMENTE.Visible = false; configurarBotonesPruebas(false, true, true); } }
private void cargar_interfaz_inicial() { configurarInfoAdicionalModulo(false, ""); categoriaPruebas _cat = new categoriaPruebas(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); DataTable tablaCat = _cat.ObtenerSelCatPruebasTodas(); if (tablaCat.Rows.Count <= 0) { configurarMensajes(true, System.Drawing.Color.Red); Label_MENSAJE.Text = "No se encontraron Categorías de prueba."; configurarMensajesPruebas(false, System.Drawing.Color.Red); configurarPanelesGenerales(false, false, false, false, false); } else { configurarMensajes(false, System.Drawing.Color.Red); configurarMensajesPruebas(false, System.Drawing.Color.Red); cargar_GridView_RESULTADOS_BUSQUEDA(tablaCat); configurarPanelesGenerales(true, false, false, false, false); } }
protected void Button_GUARDAR_CATEGORIA_Click(object sender, EventArgs e) { tools _tools = new tools(); SecureQueryString QueryStringSeguro; QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]); String accion = QueryStringSeguro["accion"].ToString(); categoriaPruebas _catPruebas = new categoriaPruebas(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); Decimal ID_CATEGORIA = 0; String NOM_CATEGORIA = TextBox_NOM_CATEGORIA.Text.ToUpper().Trim(); String OBSERVACIONES = TextBox_Observaciones.Text.ToUpper().Trim(); String USU_CRE = Session["USU_LOG"].ToString(); String USU_MOD = Session["USU_LOG"].ToString(); Boolean verificador = true; if (String.IsNullOrEmpty(TextBox_ID_CATEGORIA.Text) == true) { ID_CATEGORIA = _catPruebas.AdicionarSelCatPruebas(NOM_CATEGORIA, OBSERVACIONES); if (ID_CATEGORIA == 0) { configurarMensajes(true, System.Drawing.Color.Red); Label_MENSAJE.Text = _catPruebas.MensajeError; } else { QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro()); QueryStringSeguro["img_area"] = "seleccion"; QueryStringSeguro["nombre_area"] = "SELECCIÓN Y REQUISICIONES"; QueryStringSeguro["nombre_modulo"] = "CATEGORIA DE PRUEBAS Y PRUEBAS"; QueryStringSeguro["accion"] = "cargarNuevaCategoria"; QueryStringSeguro["categoria"] = ID_CATEGORIA.ToString(); Response.Redirect("~/seleccion/categoriasyPruebas.aspx?data=" + HttpUtility.UrlEncode(QueryStringSeguro.ToString())); } } else { ID_CATEGORIA = Convert.ToDecimal(TextBox_ID_CATEGORIA.Text); verificador = _catPruebas.ActualizarSelCatPruebas(Convert.ToInt32(ID_CATEGORIA), NOM_CATEGORIA, OBSERVACIONES); if (verificador == false) { configurarMensajes(true, System.Drawing.Color.Red); Label_MENSAJE.Text = _catPruebas.MensajeError; } else { QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro()); QueryStringSeguro["img_area"] = "seleccion"; QueryStringSeguro["nombre_area"] = "SELECCIÓN Y REQUISICIONES"; QueryStringSeguro["nombre_modulo"] = "CATEGORIAS DE PRUEBAS"; QueryStringSeguro["accion"] = "cargarModificadaCategoria"; QueryStringSeguro["categoria"] = ID_CATEGORIA.ToString(); Response.Redirect("~/seleccion/categoriasyPruebas.aspx?data=" + HttpUtility.UrlEncode(QueryStringSeguro.ToString())); } } }
protected void GridView_RESULTADOS_BUSQUEDA_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView_RESULTADOS_BUSQUEDA.PageIndex = e.NewPageIndex; categoriaPruebas _cat = new categoriaPruebas(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); DataTable tablaCat = _cat.ObtenerSelCatPruebasTodas(); cargar_GridView_RESULTADOS_BUSQUEDA(tablaCat); }
protected void Button_GUARDAR_PRUEBA_Click(object sender, EventArgs e) { tools _tools = new tools(); SecureQueryString QueryStringSeguro; QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]); Decimal ID_CATEGORIA = Convert.ToDecimal(QueryStringSeguro["categoria"]); String NOM_PRUEBA = TextBox_NOM_PRUEBA.Text.Trim(); String OBS_PRUEBA = TextBox_Comentarios.Text.Trim(); Byte[] ARCHIVO = null; Int32 ARCHIVO_TAMANO = 0; String ARCHIVO_EXTENSION = null; String ARCHIVO_TYPE = null; if (FileUpload_ARCHIVO.HasFile == true) { using (BinaryReader reader = new BinaryReader(FileUpload_ARCHIVO.PostedFile.InputStream)) { ARCHIVO = reader.ReadBytes(FileUpload_ARCHIVO.PostedFile.ContentLength); ARCHIVO_TAMANO = FileUpload_ARCHIVO.PostedFile.ContentLength; ARCHIVO_TYPE = FileUpload_ARCHIVO.PostedFile.ContentType; ARCHIVO_EXTENSION = _tools.obtenerExtensionArchivo(FileUpload_ARCHIVO.PostedFile.FileName); } } categoriaPruebas _pruebas = new categoriaPruebas(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); Decimal ID_PRUEBA = 0; if (String.IsNullOrEmpty(TextBox_ID_PRUEBA.Text) == true) { ID_PRUEBA = _pruebas.AdicionarSelPruebas(NOM_PRUEBA, ID_CATEGORIA, OBS_PRUEBA, ARCHIVO, ARCHIVO_EXTENSION, ARCHIVO_TAMANO, ARCHIVO_TYPE); if (_pruebas.MensajeError != null) { configurarInfoAdicionalModulo(false, ""); configurarMensajes(true, System.Drawing.Color.Red); Label_MENSAJE.Text = _pruebas.MensajeError; } else { QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro()); QueryStringSeguro["img_area"] = "seleccion"; QueryStringSeguro["nombre_area"] = "SELECCIÓN Y REQUISICIONES"; QueryStringSeguro["nombre_modulo"] = "CATEGORÍA DE PRUEBAS Y PRUEBAS"; QueryStringSeguro["accion"] = "cargarNuevaPrueba"; QueryStringSeguro["categoria"] = ID_CATEGORIA.ToString(); QueryStringSeguro["prueba"] = ID_PRUEBA.ToString(); Response.Redirect("~/seleccion/categoriasyPruebas.aspx?data=" + HttpUtility.UrlEncode(QueryStringSeguro.ToString())); } } else { Boolean verificador = true; ID_PRUEBA = Convert.ToDecimal(TextBox_ID_PRUEBA.Text); verificador = _pruebas.ActualizarSelPrueba(ID_PRUEBA, NOM_PRUEBA, OBS_PRUEBA, ARCHIVO, ARCHIVO_EXTENSION, ARCHIVO_TAMANO, ARCHIVO_TYPE); if (verificador == false) { configurarInfoAdicionalModulo(false, ""); configurarMensajes(true, System.Drawing.Color.Red); Label_MENSAJE.Text = _pruebas.MensajeError; } else { QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro()); QueryStringSeguro["img_area"] = "seleccion"; QueryStringSeguro["nombre_area"] = "SELECCIÓN Y REQUISICIONES"; QueryStringSeguro["nombre_modulo"] = "CATEGORÍA DE PRUEBAS Y PRUEBAS"; QueryStringSeguro["accion"] = "cargarModificadaPrueba"; QueryStringSeguro["categoria"] = ID_CATEGORIA.ToString(); QueryStringSeguro["prueba"] = ID_PRUEBA.ToString(); Response.Redirect("~/seleccion/categoriasyPruebas.aspx?data=" + HttpUtility.UrlEncode(QueryStringSeguro.ToString())); } } }
private void cargar_DropDownList_PRUEBA() { this.DropDownList_NOMBRE_PRUEBA.Items.Clear(); categoriaPruebas _categoriaPruebas = new categoriaPruebas(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); DataTable tablaDocumento = _categoriaPruebas.ObtenerTodosLasPruebas(); ListItem item = new ListItem("Seleccione...", ""); DropDownList_NOMBRE_PRUEBA.Items.Add(item); foreach (DataRow fila in tablaDocumento.Rows) { item = new ListItem(fila["NOM_PRUEBA"].ToString(), fila["ID_PRUEBA"].ToString()); DropDownList_NOMBRE_PRUEBA.Items.Add(item); } DropDownList_NOMBRE_PRUEBA.DataBind(); }