protected void btnProcesar_Click(object sender, EventArgs e) { BLReportes rep = new BLReportes(); int Anio; lblNoRegs.Visible = false; lblNoRegs.Text = "No se encontraron registros"; int.TryParse(ddlAnio.SelectedValue, out Anio); if (Page.IsValid) { int Empleado = 0; int.TryParse(txtFiltro.Text, out Empleado); grdDatos.DataSource = rep.Documentos(ddlTipo.SelectedValue, "", Anio, Empleado.ToString()); grdDatos.DataBind(); if (grdDatos.Rows.Count == 0) { lblNoRegs.Visible = true; } } else { lblNoRegs.Text = "No se ha ingresado toda la información necesaria. Revise por favor."; } }
public JsonResult GetIngresoUnico(string nroSeguimiento) { BLReportes blReportes = new BLReportes(); GenericResponse <IngresosResponse> response = blReportes.ObtenerIngresoUnico(nroSeguimiento); return(Json(response)); }
protected void btnAgregar02_Click(object sender, EventArgs e) { if (!Validar02()) { if (!rbEstiloddl02.Checked && !rbEstilochk02.Checked) { lblMsj02.Text = "Debe seleccionar un estilo."; } else { BLReportes objRpt = new BLReportes(); string Resp = ""; if (rbEstilochk02.Checked) { Resp = objRpt.InsertarCatalogo(DatosGenerales.EstiloReportesDinamicos.eCheckBoxList, txtDescripcion02.Text.Trim(), txtScriptPaso02.Text.Trim(), ddlCnx.SelectedValue, false, hddTipo02.Value); } else { Resp = objRpt.InsertarCatalogo(DatosGenerales.EstiloReportesDinamicos.eDropDownList, txtDescripcion02.Text.Trim(), txtScriptPaso02.Text.Trim(), ddlCnx.SelectedValue, false, hddTipo02.Value); } if (!Resp.Contains("Existe")) { MsgBox.AddMessage("Se ha agregado el catálogo", YaBu.MessageBox.uscMsgBox.enmMessageType.Success); Limpieza02(true); } else { MsgBox.AddMessage("Ya existe un catálogo con ese nombre. Ingrese uno diferente.", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); txtDescripcion02.Focus(); } } } }
protected void CargarReporte() { int RD_Id = 0; int.TryParse(ddlReportes.SelectedValue, out RD_Id); btnEjecutar.Visible = false; if (RD_Id > 0) { BLReportes objRpt = new BLReportes(); System.Data.DataTable Resultados = new System.Data.DataTable(); Resultados = objRpt.ObtenerParametrosReporteOrdenado(RD_Id); grdParams.DataSource = Resultados; grdParams.DataBind(); grdParams.Columns[CeldaParam].Visible = false; if (Resultados.Rows.Count > 0) { hddConexion.Value = Resultados.Rows[0]["RD_Conexion"].ToString(); for (int w = 0; w < Resultados.Rows.Count; w++) { AsignarHidden(w, Resultados.Rows[w]); AsignarLabel(w, Resultados.Rows[w]); HabilitarControles(w, Resultados.Rows[w]); } } btnEjecutar.Visible = true; } }
protected void CargaCatalogoLst(ref DropDownList ddl, string Id, string Conexion) { BLDatosGenerales objGen = new BLDatosGenerales(); BLReportes objRpt = new BLReportes(); System.Data.DataTable Resultados = new System.Data.DataTable(); int RDC_Id = 0; string Script = ""; int.TryParse(Id, out RDC_Id); Resultados = objRpt.ObtenerScriptCatalogo(RDC_Id); if (Resultados.Rows.Count > 0) { Script = Resultados.Rows[0][0].ToString(); } Resultados = new System.Data.DataTable(); if (RDC_Id > 0 && Script != "") { Resultados = objGen.TestScript(Script, System.Configuration.ConfigurationManager.ConnectionStrings[Conexion].ConnectionString); } if (Resultados.Rows.Count > 0) { ddl.DataValueField = "Valor"; ddl.DataTextField = "Descripcion"; ddl.DataSource = Resultados; ddl.DataBind(); } }
protected void chkAutorizado_CheckedChanged(object sender, EventArgs e) { BLReportes objRpt = new BLReportes(); GridViewRow row = (GridViewRow)((DataControlFieldCell)((CheckBox)sender).Parent).Parent; CheckBox chk = (CheckBox)row.FindControl("chkAutorizado"); int RD_Id = 0; bool EsCat = false; int.TryParse(row.Cells[CeldaId].Text, out RD_Id); if (row.Cells[CeldaTipo].Text.ToLowerInvariant() == "catálogo") { EsCat = true; } if (RD_Id > 0) { objRpt.ActualizarAutorizacionReporte(RD_Id, chk.Checked, EsCat); if (chk.Checked) { MsgBox.AddMessage("El reporte " + row.Cells[CeldaNombre].Text + " fue dado de alta.", YaBu.MessageBox.uscMsgBox.enmMessageType.Success); } else { MsgBox.AddMessage("El reporte " + row.Cells[CeldaNombre].Text + " fue dado de baja.", YaBu.MessageBox.uscMsgBox.enmMessageType.Success); } } else { MsgBox.AddMessage("No se obtuvo el Id del reporte", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } }
protected void grdDatos_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.ToLowerInvariant() == "detalle") { int grdId = -1; int.TryParse(e.CommandArgument.ToString(), out grdId); if (grdId >= 0) { BLReportes objRpt = new BLReportes(); txtScript.Text = grdDatos.Rows[grdId].Cells[CeldaScript].Text; lblConexion.Text = "Conexión: " + grdDatos.Rows[grdId].Cells[CeldaConexion].Text; lblTipo.Text = "Tipo: " + grdDatos.Rows[grdId].Cells[CeldaTipo].Text; if (grdDatos.Rows[grdId].Cells[CeldaTipo].Text.ToLowerInvariant() == "stored procedure") { lblTipo.Text = "Tipo: " + grdDatos.Rows[grdId].Cells[CeldaTipo].Text + " (" + grdDatos.Rows[grdId].Cells[CeldaScript].Text + ")"; txtScript.Text = objRpt.ScriptStored(grdDatos.Rows[grdId].Cells[CeldaConexion].Text, grdDatos.Rows[grdId].Cells[CeldaScript].Text); } mp1.Show(); } } }
protected void btnProcesar04_Click(object sender, EventArgs e) { int RDTS_Id = 0; pnlTipo04.Visible = false; lblMsjGrid04.Text = ValidarGridParams(); int.TryParse(ddlTipoScript.SelectedValue, out RDTS_Id); if (lblMsjGrid04.Text == "") { BLReportes objRpt = new BLReportes(); int RD_Id = 0; string MsjBD = ""; int.TryParse(ddlReportesStored.SelectedValue, out RD_Id); if (RD_Id > 0) { bool AplicarBorradoPrevio = true; int MsjBDExiste = objRpt.ActualizarReporte(RD_Id, txtNombreReporte.Text.Trim(), ddlStored.SelectedValue, Session["UserNameLogin"].ToString()); if (MsjBDExiste == 1) { for (int w = 0; w < grdParams.Rows.Count; w++) { BLReportes.RptDinamicosParametro param = new BLReportes.RptDinamicosParametro(grdParams.Rows[w]); MsjBD += objRpt.InsertarParametro(RD_Id, param.Nombre, param.Tipo, param.TipoDato, param.Longitud, param.Obligatorio, param.Entrada, param.Catalogo, param.AceptaNulo, param.BusquedaAproximada, param.Descripcion, AplicarBorradoPrevio); AplicarBorradoPrevio = false; } if (MsjBD == "") { MsjBD = "OK"; } } else { MsjBD = "Ya existe un reporte con ese nombre."; } } else { lblMsjGrid04.Text = "No se obtuvo el ID del reporte."; } if (MsjBD == "OK") { DatosGenerales.EnviaMensaje("Proceso finalizado", "Modificación de reporte", DatosGenerales.TiposMensaje.Informacion); } else { lblMsjGrid04.Text = MsjBD; } } }
protected void CargaCatalogos() { BLReportes objRpt = new BLReportes(); if (Session["UserNameLogin"] != null) { objRpt.ReportesUsuario(ref ddlReportes, Session["UserNameLogin"].ToString()); } }
protected void CargaParamsStored() { BLReportes objRep = new BLReportes(); hddGridStoredProcesado.Value = "0"; grdParams.DataSource = objRep.ParametrosStored(ddlCnx.SelectedValue, ddlStored.SelectedValue); grdParams.DataBind(); grdParams.Columns[CeldaTipo].Visible = false; hddGridStoredProcesado.Value = "1"; }
public JsonResult GetIngresos(string nroSeguimiento, int proveedor, string destinatario, string fechaDesde, string fechaHasta, string autorizado) { var estadoParaEgresos = Constants.Pedidos.ID_INGRESADO + "," + Constants.Pedidos.ID_DISPONIBLE_PARA_RETIRO; //"1,3" //Configurar con el web config //var estadoParaEgresos = new List<int>() { 1, 3 }; var canalizacion = ConfigurationManager.AppSettings["ID_CANALIZACION_RETIRA_COLABORADOR"] + "," + ConfigurationManager.AppSettings["ID_CANALIZACION_RETIRA_TERCERO"] + "," + ConfigurationManager.AppSettings["ID_CANALIZACION_RETIRA_LABORAL"]; BLReportes blReportes = new BLReportes(); GenericResponse <IngresosResponse> response = blReportes.ObtenerEgresosFilter(nroSeguimiento, 0, null, proveedor, destinatario, fechaDesde, fechaHasta, canalizacion.ToString(), estadoParaEgresos.ToString(), autorizado); return(Json(response)); }
protected void CargaDatos() { BLReportes objRpt = new BLReportes(); grdDatos.DataSource = objRpt.ObtenerReportesAutorizaciones(); grdDatos.DataBind(); grdDatos.Columns[CeldaId].Visible = false; grdDatos.Columns[CeldaConexion].Visible = false; grdDatos.Columns[CeldaScript].Visible = false; grdDatos.Columns[CeldaAutorizado].Visible = false; }
protected void btnProcesar03_Click(object sender, EventArgs e) { lblMsj03.Text = ""; int TipoScript = 0; int.TryParse(ddlTipoScript.SelectedValue, out TipoScript); pnlTexto.Visible = false; pnlStored.Visible = false; pnlSSIS.Visible = false; if (!string.IsNullOrWhiteSpace(ddlTipoScript.SelectedValue)) { BLCatalogos objCat = new BLCatalogos(); pnlPaso03.Visible = false; pnlPaso04.Visible = true; switch (TipoScript) { case (int)DatosGenerales.TiposScript.Texto: pnlTexto.Visible = true; objCat.ListaReportes(ref ddlReportesTexto, (int)DatosGenerales.TiposScript.Texto, ddlCnx.SelectedValue); break; case (int)DatosGenerales.TiposScript.Stored: pnlStored.Visible = true; objCat.ListaReportes(ref ddlReportesStored, (int)DatosGenerales.TiposScript.Stored, ddlCnx.SelectedValue); CargaStored(); break; case (int)DatosGenerales.TiposScript.Paquete: pnlSSIS.Visible = true; break; } BLReportes objRpt = new BLReportes(); DatosGenerales.TipoCatalogoRpt(ref ddlTipo04); DatosGenerales.TipoCatalogoRpt(ref ddlTipo04Q); ddlTipoDatoQ.DataValueField = "Valor"; ddlTipoDatoQ.DataTextField = "Descripcion"; ddlTipoDatoQ.DataSource = objRpt.ObtenerTiposDato(ddlCnx.SelectedValue); ddlTipoDatoQ.DataBind(); } else { lblMsj03.Text = "Debe seleccionar un elemento de la lista."; } }
protected void Cargar(int Pagina) { BLReportes objRep = new BLReportes(); DateTime FechaIni = DatosGenerales.ObtieneFecha(txtFechaIni.Text); DateTime FechaFin = DatosGenerales.ObtieneFecha(txtFechaFin.Text); DateTime FechaTmp; int Prestamo = 0; pnlDatos.Visible = false; lblMsj.Text = ""; if (chkFechas.Checked) { if (FechaIni.ToString("yyyyMMdd") == "19000101" || FechaFin.ToString("yyyyMMdd") == "19000101") { lblMsj.Text = "Fecha incorrecta. Revise."; return; } if (FechaIni > FechaFin) { FechaTmp = FechaIni; FechaIni = FechaFin; FechaFin = FechaTmp; txtFechaIni.Text = FechaIni.ToString("dd/MM/yyyy"); txtFechaFin.Text = FechaFin.ToString("dd/MM/yyyy"); } } int.TryParse(txtPrestamo.Text, out Prestamo); grdDatos.Columns[CeldaId].Visible = true; grdDatos.DataSource = objRep.ReporteCartasGeneradas(Prestamo, txtAcreditado.Text, chkFechas.Checked, FechaIni, FechaFin); grdDatos.PageIndex = Pagina; grdDatos.DataBind(); grdDatos.Columns[CeldaId].Visible = false; if (grdDatos.Rows.Count > 0) { pnlDatos.Visible = true; } else { lblMsj.Text = "No se encontraron resultados."; } }
protected System.Data.DataTable BuscarDT() { System.Data.DataTable Resultados = new System.Data.DataTable(); string Validaciones = Valida(); BLReportes reporte = new BLReportes(); pnlGrid.Visible = false; if (Validaciones == "") { Resultados = reporte.ReporteInventarioSW(ArmadoCadena(chklEmpresas), ArmadoCadena(chklGrupos, 1), txtDescripcionSW.Text, txtVersiones.Text, txtNoParte.Text, txtLlaves.Text, ArmadoCadena(chklUbicacion), txtObservaciones.Text, ddlExistencia.SelectedValue, false).Tables[0]; if (Resultados.Rows.Count == 0) { Accordion1.SelectedIndex = 0; uscMsgBox1.AddMessage("No se encontraron registros para exportar", YaBu.MessageBox.uscMsgBox.enmMessageType.Info); } else { Accordion1.SelectedIndex = 1; pnlGrid.Visible = true; } } else { uscMsgBox1.AddMessage(Validaciones, YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } return(Resultados); }
protected void RegistrarQuery() { BLDatosGenerales objGen = new BLDatosGenerales(); if (string.IsNullOrWhiteSpace(txtScriptPaso04.Text)) { btnIngresarQ.Text = "Ingresar script"; } else { btnIngresarQ.Text = "Modificar script"; } txtScriptPaso04.Text = objGen.FormatearSQL_TextoSimple(txtScriptPaso04.Text, 4); IEnumerable <string> Variables = AnalizarScript(txtScriptPaso04.Text); if (Variables.Count() > 0) { BLReportes objRpt = new BLReportes(); grdParamsQ.DataSource = objRpt.CargarParametrosScript(Variables); grdParamsQ.DataBind(); grdParamsQ.Columns[CeldaTipo].Visible = false; btnProcesar04Q.Visible = true; pnlGridQ.Visible = true; } else { grdParamsQ.DataSource = null; grdParamsQ.DataBind(); btnProcesar04Q.Visible = false; pnlGridQ.Visible = false; lblMsj04Script.Text = "No se encontraron variables en el script."; } }
protected void Buscar() { try { string Validaciones = Valida(); BLReportes reporte = new BLReportes(); System.Data.DataSet Resumen = new System.Data.DataSet(); System.Data.DataTable Resultados = new System.Data.DataTable(); pnlGrid.Visible = false; if (Validaciones == "") { Resumen = reporte.ReporteInventarioSW(ArmadoCadena(chklEmpresas), ArmadoCadena(chklGrupos, 1), txtDescripcionSW.Text, txtVersiones.Text, txtNoParte.Text, txtLlaves.Text, ArmadoCadena(chklUbicacion), txtObservaciones.Text, ddlExistencia.SelectedValue, true); Resultados = Resumen.Tables[0]; grdDatos.DataSource = Resultados; grdDatos.DataBind(); if (grdDatos.Rows.Count == 0) { uscMsgBox1.AddMessage("No se encontraron registros para exportar", YaBu.MessageBox.uscMsgBox.enmMessageType.Info); } else { Accordion1.SelectedIndex = 1; pnlGrid.Visible = true; if (Resultados.TableName != "Error") { grdEmpresas.DataSource = Resumen.Tables[1]; grdEmpresas.DataBind(); grdGrupos.DataSource = Resumen.Tables[2]; grdGrupos.DataBind(); grdDescripciones.DataSource = Resumen.Tables[3]; grdDescripciones.DataBind(); grdLicencias.DataSource = Resumen.Tables[4]; grdLicencias.DataBind(); grdUbicaciones.DataSource = Resumen.Tables[5]; grdUbicaciones.DataBind(); } } } else { uscMsgBox1.AddMessage(Validaciones, YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } } catch (Exception ex) { uscMsgBox1.AddMessage(ex.Message + "<br />" + ex.StackTrace, YaBu.MessageBox.uscMsgBox.enmMessageType.Error); } }
protected void CompararDatosQ(int RD_Id, bool PreviamenteCargado = true) { System.Data.DataTable Resultados = new System.Data.DataTable(); BLReportes objRpt = new BLReportes(); Resultados = objRpt.ObtenerParametrosReporte(RD_Id); txtNombreReporteQ.Text = ddlReportesTexto.SelectedItem.Text; if (PreviamenteCargado) { txtScriptPaso04.Text = Resultados.Rows[0]["RD_Script"].ToString(); RegistrarQuery(); } for (int w = 0; w < Resultados.Rows.Count; w++) { foreach (GridViewRow row in grdParamsQ.Rows) { if (Resultados.Rows[w]["Nombre"].ToString() == row.Cells[CeldaNombre].Text) { Label lblE = (Label)row.FindControl("lblEntrada"); Label lblC = (Label)row.FindControl("lblCat"); Label lblN = (Label)row.FindControl("lblNull"); Label lblB = (Label)row.FindControl("lblBAprox"); Label lblD = (Label)row.FindControl("lblDesc"); CheckBox chkO = (CheckBox)row.FindControl("chkObligatorio"); if (Resultados.Rows[w]["RDP_Obligatorio"].ToString() == "1") { chkO.Checked = true; } else { chkO.Checked = false; } lblE.Text = Resultados.Rows[w]["RDP_Entrada"].ToString(); lblC.Text = Resultados.Rows[w]["RDC_Id"].ToString(); lblD.Text = Resultados.Rows[w]["RDP_Texto"].ToString(); if (Resultados.Rows[w]["RDP_AceptaNulo"].ToString() == "1") { lblN.Text = "Si"; } else { lblN.Text = "No"; } if (Resultados.Rows[w]["RDP_BusquedaAproximada"].ToString() == "1") { lblB.Text = "Si"; } else { lblB.Text = "No"; } if (chkO.Checked) { lblN.Text = "No"; } row.Cells[CeldaTipoDato].Text = Resultados.Rows[w]["TipoDato"].ToString(); row.Cells[CeldaLongitud].Text = Resultados.Rows[w]["Longitud"].ToString(); break; } } } pnlTextoC.Visible = true; }
internal void LlenaIndices() { BLReportes rpTipoActivoLista = new BLReportes(); hdnIndicesChk.Value += rpTipoActivoLista.RegresaIndexTipoActivo(); }
protected void CompararDatos(int RD_Id, bool PreviamenteCargado = true) { System.Data.DataTable Resultados = new System.Data.DataTable(); BLReportes objRpt = new BLReportes(); Resultados = objRpt.ObtenerParametrosReporte(RD_Id); txtNombreReporte.Text = ddlReportesStored.SelectedItem.Text; ddlStored.SelectedValue = Resultados.Rows[0]["RD_Script"].ToString(); if (PreviamenteCargado) { grdParams.SelectedIndex = -1; pnlTipo04.Visible = false; if (!string.IsNullOrWhiteSpace(ddlStored.SelectedValue)) { CargaParamsStored(); } else { grdParams.DataSource = null; grdParams.DataBind(); } if (grdParams.Rows.Count > 0) { btnProcesar04.Visible = true; pnlGrid.Visible = true; } else { btnProcesar04.Visible = false; pnlGrid.Visible = false; } } for (int w = 0; w < Resultados.Rows.Count; w++) { foreach (GridViewRow row in grdParams.Rows) { if (Resultados.Rows[w]["Nombre"].ToString() == row.Cells[CeldaNombre].Text) { Label lblE = (Label)row.FindControl("lblEntrada"); Label lblC = (Label)row.FindControl("lblCat"); Label lblN = (Label)row.FindControl("lblNull"); Label lblB = (Label)row.FindControl("lblBAprox"); Label lblD = (Label)row.FindControl("lblDesc"); CheckBox chkO = (CheckBox)row.FindControl("chkObligatorio"); if (Resultados.Rows[w]["RDP_Obligatorio"].ToString() == "1") { chkO.Checked = true; } else { chkO.Checked = false; } lblE.Text = Resultados.Rows[w]["RDP_Entrada"].ToString(); lblC.Text = Resultados.Rows[w]["RDC_Id"].ToString(); lblD.Text = Resultados.Rows[w]["RDP_Texto"].ToString(); if (Resultados.Rows[w]["RDP_AceptaNulo"].ToString() == "1") { lblN.Text = "Si"; } else { lblN.Text = "No"; } if (Resultados.Rows[w]["RDP_BusquedaAproximada"].ToString() == "1") { lblB.Text = "Si"; } else { lblB.Text = "No"; } if (chkO.Checked) { lblN.Text = "No"; } row.Cells[CeldaTipoDato].Text = Resultados.Rows[w]["TipoDato"].ToString(); row.Cells[CeldaLongitud].Text = Resultados.Rows[w]["Longitud"].ToString(); break; } } } pnlStoredC.Visible = true; }