private void ugParametros_ClickCellButton(object sender, CellEventArgs e) { try { if (Reporte.EntidadSF == null) { throw new Exception("Seleccionar la Entidad SF ..."); } ParametroReporte Parametro = (ParametroReporte)e.Cell.Row.Tag; switch (e.Cell.Column.Key) { case colPropiedad: FrmSelectedProperty SelecionarPropiedad = new FrmSelectedProperty(); Parametro.Propiedad = SelecionarPropiedad.GetSeletedProperty(Reporte.EntidadSF.ID); break; default: break; } MostrarParametro(e.Cell.Row); } catch (Exception) { throw; } }
public void MostrarParametro(UltraGridRow Row) { ParametroReporte Item = (ParametroReporte)Row.Tag; Row.Cells[colPropiedad].Activation = (Item.Tipo.Equals("SQL/Propiedad")) ? Activation.AllowEdit : Activation.NoEdit; Row.Cells[colNombre].Value = Item.Nombre; Row.Cells[colTipo].Value = Item.Tipo; Row.Cells[colPropiedad].Value = Item.Propiedad; Row.Cells[colValor].Value = Item.Valor; }
private void ugParametros_CellChange(object sender, CellEventArgs e) { ParametroReporte Parametro = (ParametroReporte)e.Cell.Row.Tag; switch (e.Cell.Column.Key) { case colNombre: Parametro.Nombre = Convert.ToString(e.Cell.Text); break; case colTipo: Parametro.Tipo = e.Cell.Column.ValueList.GetValue(e.Cell.Column.ValueList.SelectedItemIndex).ToString(); break; case colValor: Parametro.Valor = Convert.ToString(e.Cell.Text); break; default: break; } MostrarParametro(e.Cell.Row); }
protected void ButtonConsultar_Click(object sender, EventArgs e) { try { //System.Threading.Thread.Sleep(5000); string strConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["cnArrendamientoInmueble"].ConnectionString; ParametroReporte oParametrosReporte = new ParametroReporte(); oParametrosReporte.IdInstitucion = this.DropDownListInstitucion.SelectedValue == "--" ? (int?)null : System.Convert.ToInt32(this.DropDownListInstitucion.SelectedValue.ToString()); oParametrosReporte.ListaCampos = this.RecuperaSeleccionCampos(); oParametrosReporte.IdTipoContrato = this.DropDownListTipoContrato.SelectedValue.Trim() == "--" ? (int?)null : System.Convert.ToInt32(this.DropDownListTipoContrato.SelectedValue.ToString()); oParametrosReporte.IdTipoOcupacion = this.DropDownListTipoOcupacion.SelectedValue.Trim() == "--" ? (int?)null : System.Convert.ToInt32(this.DropDownListTipoOcupacion.SelectedValue.ToString()); oParametrosReporte.RangoFechaRegistroInicial = this.TextBoxFechaRegistroInicio.Text.Trim() == "" ? "0" : this.TextBoxFechaRegistroInicio.Text.Trim(); oParametrosReporte.RangoFechaRegistroFinal = this.TextBoxFechaRegistroFinal.Text.Trim() == "" ? "0" : this.TextBoxFechaRegistroFinal.Text.Trim(); oParametrosReporte.RangoFechaInicioOcupacionInicial = this.TextBoxFechaIOcupacionInicio.Text.Trim() == "" ? "0" : this.TextBoxFechaIOcupacionInicio.Text.Trim(); oParametrosReporte.RangoFechaInicioOcupacionFinal = this.TextBoxFechaIOcupacionFinal.Text.Trim() == "" ? "0" : this.TextBoxFechaIOcupacionFinal.Text.Trim(); oParametrosReporte.RangoFechaTerminoOcupacionInicial = this.TextBoxFechaFOcupacionInicio.Text.Trim() == "" ? "0" : this.TextBoxFechaFOcupacionInicio.Text.Trim(); oParametrosReporte.RangoFechaTerminoOcupacionFinal = this.TextBoxFechaFOcupacionFinal.Text.Trim() == "" ? "0" : this.TextBoxFechaFOcupacionFinal.Text.Trim(); if (!ValidaParametros(oParametrosReporte)) { return; } DataTable oReportTable = new NG_Reportes().SelectReporteInmuebles(strConnectionString, oParametrosReporte); if (oReportTable == null) { this.pnlReporte.Visible = false; this.ButtonExportar.Visible = false; Msj = "La consulta no ha devuelto resultados, verifica los filtros de busqueda."; this.LabelInfo.Text = "<div class='alert alert-danger'><strong> Error </strong>" + Msj + "</div>"; this.LabelInfoResult.Text = "<div class='alert alert-danger'> " + Msj + "</div>"; MostrarMensajeJavaScript(Msj); return; } else { this.pnlReporte.Visible = true; this.ButtonExportar.Visible = true; this.GridViewReporte.DataSource = oReportTable; this.GridViewReporte.DataBind(); Session[this.lblTableNameReport.Text] = oReportTable; Msj = "La consulta ha devuelto " + oReportTable.Rows.Count.ToString() + " registro(s)"; this.LabelInfo.Text = "<div class='alert alert-info'>" + Msj + "</div>"; this.LabelInfoResult.Text = "<div class='alert alert-info'>" + Msj + "</div>"; MostrarMensajeJavaScript(Msj); return; } } catch (Exception ex) { Msj = "Ha ocurrido un error al recuperar el reporte. Contacta al área de sistemas."; this.LabelInfo.Text = "<div class='alert alert-danger'><strong> Error </strong>" + Msj + "</div>"; this.LabelInfoResult.Text = this.LabelInfo.Text; MostrarMensajeJavaScript(Msj); BitacoraExcepcion BitacoraExcepcionAplictivo = new BitacoraExcepcion { CadenaconexionBD = System.Configuration.ConfigurationManager.ConnectionStrings["cnArrendamientoInmueble"].ConnectionString, Aplicacion = "ContratosArrto", Modulo = MethodInfo.GetCurrentMethod().DeclaringType.ToString() + ".aspx", Funcion = MethodBase.GetCurrentMethod().Name + "()", DescExcepcion = ex.InnerException == null ? ex.Message : ex.InnerException.Message, Usr = ((SSO)Session["Contexto"]).UserName.ToString() }; BitacoraExcepcionAplictivo.RegistrarBitacoraExcepcion(); BitacoraExcepcionAplictivo = null; } }
private bool ValidaParametros(ParametroReporte oParametros) { //MZT 14/jun/2017 if (oParametros.ListaCampos == null || oParametros.ListaCampos.Count == 0) { Msj = "Debe seleccionar al menos un campo para el reporte."; this.LabelInfo.Text = "<div class='alert alert-danger'><strong> Error </strong>" + Msj + "</div>"; this.LabelInfoResult.Text = "<div class='alert alert-danger'> " + Msj + "</div>"; MostrarMensajeJavaScript(Msj); return(false); } if (oParametros.RangoFechaRegistroInicial != "0" && oParametros.RangoFechaRegistroFinal == "0") { Msj = "Debe seleccionar un rango valido para la fecha de registro del Contrato"; this.LabelInfo.Text = "<div class='alert alert-danger'><strong> Error </strong>" + Msj + "</div>"; this.LabelInfoResult.Text = "<div class='alert alert-danger'> " + Msj + "</div>"; MostrarMensajeJavaScript(Msj); return(false); } if (oParametros.RangoFechaRegistroInicial != "0" && oParametros.RangoFechaRegistroFinal != "0") { if (Convert.ToDateTime(oParametros.RangoFechaRegistroInicial) > Convert.ToDateTime(oParametros.RangoFechaRegistroFinal)) { Msj = "La fecha final del rango de registro de contrato debe ser mayor a la fecha inicial."; this.LabelInfo.Text = "<div class='alert alert-danger'><strong> Error </strong>" + Msj + "</div>"; this.LabelInfoResult.Text = "<div class='alert alert-danger'> " + Msj + "</div>"; MostrarMensajeJavaScript(Msj); return(false); } } if (oParametros.RangoFechaInicioOcupacionInicial != "0" && oParametros.RangoFechaInicioOcupacionFinal == "0") { Msj = "Debe seleccionar un rango final valido para la fecha de inicio de ocupación."; this.LabelInfo.Text = "<div class='alert alert-danger'><strong> Error </strong>" + Msj + "</div>"; this.LabelInfoResult.Text = "<div class='alert alert-danger'> " + Msj + "</div>"; MostrarMensajeJavaScript(Msj); return(false); } if (oParametros.RangoFechaTerminoOcupacionInicial != "0" && oParametros.RangoFechaTerminoOcupacionFinal == "0") { Msj = "Debe seleccionar un rango valido para la fecha de término de ocupación."; this.LabelInfo.Text = "<div class='alert alert-danger'><strong> Error </strong>" + Msj + "</div>"; this.LabelInfoResult.Text = "<div class='alert alert-danger'> " + Msj + "</div>"; MostrarMensajeJavaScript(Msj); return(false); } if (oParametros.RangoFechaInicioOcupacionInicial != "0" && oParametros.RangoFechaInicioOcupacionFinal != "0") { if (Convert.ToDateTime(oParametros.RangoFechaInicioOcupacionInicial) > Convert.ToDateTime(oParametros.RangoFechaInicioOcupacionFinal)) { Msj = "La fecha final del rango de inicio de ocupación debe ser mayor a la fecha inicial."; this.LabelInfo.Text = "<div class='alert alert-danger'><strong> Error </strong>" + Msj + "</div>"; this.LabelInfoResult.Text = "<div class='alert alert-danger'> " + Msj + "</div>"; MostrarMensajeJavaScript(Msj); return(false); } } if (oParametros.RangoFechaTerminoOcupacionInicial != "0" && oParametros.RangoFechaTerminoOcupacionFinal != "0") { if (Convert.ToDateTime(oParametros.RangoFechaTerminoOcupacionInicial) > Convert.ToDateTime(oParametros.RangoFechaTerminoOcupacionFinal)) { Msj = "La fecha final del rango de termino de ocupación debe ser mayor a la fecha inicial."; this.LabelInfo.Text = "<div class='alert alert-danger'><strong> Error </strong>" + Msj + "</div>"; this.LabelInfoResult.Text = "<div class='alert alert-danger'> " + Msj + "</div>"; MostrarMensajeJavaScript(Msj); return(false); } } this.LabelInfo.Text = ""; this.LabelInfoResult.Text = ""; return(true); }