protected void UsuarioSeleccionaOpcionDeVista_ItemClick(object source, MenuItemEventArgs e) { if (!ValidarConexionYUsuarioLogueado(source)) { return; } try { switch (e.Item.Name) { case "UiBotonGenerarReporte": if (UiVistaConsignacion.VisibleRowCount == 0) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: No hay registros para mostrar. Por favor, verifique y vuelva a intentar.');", true); } else { GenerarReporte(); ASPxPopupControl1.ShowOnPageLoad = true; } break; case "btnExcel": UIVistaReporteExportar.WriteXlsxToResponse(); break; } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e) { if (!ValidarConexionYUsuarioLogueado(source)) { return; } try { switch (e.Item.Name) { case "btnFind": ScriptManager.RegisterStartupScript(this, GetType(), "llamarCall2", "UsuarioDeseaObtenerReporte();", true); break; case "UiBotonGenerarReporte": GenerarReporte(); ASPxPopupControl1.ShowOnPageLoad = true; break; case "btnExcel": UIVistaReporteExportar.WriteXlsxToResponse(); break; case "btnPdf": UIVistaReporteExportar.WritePdfToResponse(); break; case "btnCsv": UIVistaReporteExportar.WriteCsvToResponse(); break; } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }