private List <List <InformeBancarioDatos.DetalleReporteEstadoCuentaConciliado> > consultaReporteEstadoCuentaConciliado() { Conexion conexion = new Conexion(); var lstDetalle = new List <InformeBancarioDatos.DetalleReporteEstadoCuentaConciliado>(); var ListasDetalle = new List <List <InformeBancarioDatos.DetalleReporteEstadoCuentaConciliado> >(); try { var informeBancario = new InformeBancarioDatos(objApp.ImplementadorMensajes); DateTime fechaInicio = DateTime.ParseExact(txtFInicial.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime fechaFin = DateTime.ParseExact(txtFFinal.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); conexion.AbrirConexion(false); for (int i = 0; i <= WUCListadoCuentasBancarias1.CuentasSeleccionadas.Count() - 1; i++) { string banco = WUCListadoCuentasBancarias1.CuentasSeleccionadas[i].Descripcion.ToString().Substring(0, 20).TrimEnd(); string numerocuenta = WUCListadoCuentasBancarias1.CuentasSeleccionadas[i].Descripcion.ToString().Substring(WUCListadoCuentasBancarias1.CuentasSeleccionadas[i].Descripcion.ToString().Length - 20).TrimStart(); lstDetalle = informeBancario.consultaReporteEstadoCuentaConciliado(conexion, fechaInicio, fechaFin, banco, numerocuenta, DrpEstatusConcepto.SelectedValue == "0" ? "" : DrpEstatusConcepto.SelectedValue, DrpEstatus.SelectedValue == "0" ? "" : DrpEstatus.SelectedValue); } ListasDetalle = Separat(lstDetalle); } catch (Exception ex) { //App.ImplementadorMensajes.MostrarMensaje(ex.Message); ScriptManager.RegisterStartupScript(this, typeof(Page), "UpdateMsg", @"alertify.alert('Conciliación bancaria','Error: " + ex.Message + "', function(){ alertify.error('Error en la solicitud'); });", true); } finally { conexion.CerrarConexion(); } return(ListasDetalle); }
private List <List <DetalleReporteEstadoCuentaDia> > consultaReporteEstadoCuentaDia(string cuenta) { Conexion conexion = new Conexion(); var lstDetalle = new List <InformeBancarioDatos.DetalleReporteEstadoCuentaDia>(); var ListasDetalle = new List <List <DetalleReporteEstadoCuentaDia> >(); string Banco = btnlista.SelectedItem.Text; try { var informeBancario = new InformeBancarioDatos(objApp.ImplementadorMensajes); DateTime fechaInicio = Convert.ToDateTime(txtFInicial.Text); DateTime fechaFin = Convert.ToDateTime(txtFFinal.Text); conexion.AbrirConexion(false); lstDetalle = informeBancario.consultaReporteEstadoCuentaPorDia(conexion, fechaInicio, fechaFin, Banco, cuenta); ListasDetalle = Separat(lstDetalle); } catch (Exception ex) { //App.ImplementadorMensajes.MostrarMensaje(ex.Message); ScriptManager.RegisterStartupScript(this, typeof(Page), "UpdateMsg", @"alertify.alert('Conciliación bancaria','Error: " + ex.Message + "', function(){ alertify.error('Error en la solicitud'); });", true); } finally { conexion.CerrarConexion(); } //Se regresa una lista de listas... con las cuentas separadas... return(ListasDetalle); }
private List <InformeBancarioDatos.DetallePosicionDiariaBancos> ConsultarPosicionDiariaBancos(int caja) { Conexion conexion = new Conexion(); var lstDetalle = new List <InformeBancarioDatos.DetallePosicionDiariaBancos>(); try { var informeBancario = new InformeBancarioDatos(objApp.ImplementadorMensajes); DateTime fechaInicio = DateTime.ParseExact(txtFInicial.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime fechaFin = DateTime.ParseExact(txtFFinal.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); conexion.AbrirConexion(false); lstDetalle = informeBancario.consultaPosicionDiariaBanco(conexion, fechaInicio, fechaFin, (byte)caja); } catch (Exception ex) { //App.ImplementadorMensajes.MostrarMensaje(ex.Message); ScriptManager.RegisterStartupScript(this, typeof(Page), "UpdateMsg", @"alertify.alert('Conciliación bancaria','Error: " + ex.Message + "', function(){ alertify.error('Error en la solicitud'); });", true); } finally { conexion.CerrarConexion(); } return(lstDetalle); }
private List <List <DetalleInformeInternosAFuturo> > consultaInformeInternosAFuturo(string cuenta) { Conexion conexion = new Conexion(); var lstDetalle = new List <ExportadorInformeInternosAFuturoDatos.DetalleInformeInternosAFuturo>(); var ListasDetalle = new List <List <DetalleInformeInternosAFuturo> >(); string Banco = btnlista.SelectedItem.Text; try { var informeBancario = new InformeBancarioDatos(objApp.ImplementadorMensajes); DateTime fechaInicio = DateTime.ParseExact(txtFInicial.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime fechaFin = DateTime.ParseExact(txtFFinal.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); //BANORTE 0671084374 cuenta = cuenta.Substring(cuenta.IndexOf(" ") + 1, cuenta.Length - cuenta.IndexOf(" ") - 1).Trim(); conexion.AbrirConexion(false); lstDetalle = informeBancario.consultaconsultaInformeInternosAFuturo(conexion, fechaInicio, fechaFin, Banco, cuenta); ListasDetalle = Separat(lstDetalle); } catch (Exception ex) { //App.ImplementadorMensajes.MostrarMensaje(ex.Message); ScriptManager.RegisterStartupScript(this, typeof(Page), "UpdateMsg", @"alertify.alert('Conciliación bancaria','Error: " + ex.Message + "', function(){ alertify.error('Error en la solicitud'); });", true); } finally { conexion.CerrarConexion(); } //Se regresa una lista de listas... con las cuentas separadas... return(ListasDetalle); }
private List <InformeBancarioDatos.DetalleReporteEstadoCuenta> consultaReporteEstadoCuenta(string cuenta) { Conexion conexion = new Conexion(); var lstDetalleCuenta = new List <InformeBancarioDatos.DetalleReporteEstadoCuenta>(); string Banco = btnlista.SelectedItem.Text; try { var informeBancario = new InformeBancarioDatos(objApp.ImplementadorMensajes); DateTime fechaInicio = DateTime.ParseExact(txtFInicial.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime fechaFin = DateTime.ParseExact(txtFFinal.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); conexion.AbrirConexion(false); lstDetalleCuenta = informeBancario.consultaReporteEstadoCuenta(conexion, fechaInicio, fechaFin, Banco, cuenta); } catch (Exception ex) { //App.ImplementadorMensajes.MostrarMensaje(ex.Message); ScriptManager.RegisterStartupScript(this, typeof(Page), "UpdateMsg", @"alertify.alert('Conciliación bancaria','Error: " + ex.Message + "', function(){ alertify.error('Error en la solicitud'); });", true); } finally { conexion.CerrarConexion(); } return(lstDetalleCuenta); }
private List <InformeBancarioDatos.DetalleBanco> consultarBancos(string Usuario) { Conexion conexion = new Conexion(); var lstDetalle = new List <InformeBancarioDatos.DetalleBanco>(); try { var informeBancario = new InformeBancarioDatos(objApp.ImplementadorMensajes); conexion.AbrirConexion(false); lstDetalle = informeBancario.consultarBancos(conexion, 1, Usuario); } catch (Exception ex) { //App.ImplementadorMensajes.MostrarMensaje(ex.Message); ScriptManager.RegisterStartupScript(this, typeof(Page), "UpdateMsg", @"alertify.alert('Conciliación bancaria','Error: " + ex.Message + "', function(){ alertify.error('Error en la solicitud'); });", true); } finally { conexion.CerrarConexion(); } return(lstDetalle); }
protected void btnConsultar_Click(object sender, EventArgs e) { try { List <List <InformeBancarioDatos.DetalleReporteEstadoCuentaConciliado> > lstDetalleTotal = new List <List <InformeBancarioDatos.DetalleReporteEstadoCuentaConciliado> >(); DateTime fechaInicio = DateTime.ParseExact(txtFInicial.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime fechaFin = DateTime.ParseExact(txtFFinal.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); Conexion conexion = new Conexion(); var lstDetalle = new List <InformeBancarioDatos.DetalleReporteEstadoCuentaConciliado>(); var ListasDetalle = new List <List <InformeBancarioDatos.DetalleReporteEstadoCuentaConciliado> >(); string cero; int contador = 0; int registrofinal = 0; if (fechaInicio.Month < 10) { cero = "0"; } else { cero = ""; } if (File.Exists(HttpRuntime.AppDomainAppPath + @"InformesExcel\" + "EdoCtaCon" + cero + fechaInicio.Month + fechaInicio.Year + ".xlsx")) { File.Delete(HttpRuntime.AppDomainAppPath + @"InformesExcel\" + "EdoCtaCon" + cero + fechaInicio.Month + fechaInicio.Year + ".xlsx"); } if (WUCListadoCuentasBancarias1.CuentasSeleccionadas != null && WUCListadoCuentasBancarias1.CuentasSeleccionadas.Count > 0) { Boolean esfinal = false; registrofinal = WUCListadoCuentasBancarias1.CuentasSeleccionadas.Count - 1; for (int i = 0; i <= WUCListadoCuentasBancarias1.CuentasSeleccionadas.Count() - 1; i++) { var informeBancario = new InformeBancarioDatos(objApp.ImplementadorMensajes); if (registrofinal == i) { esfinal = true; } conexion.AbrirConexion(false); string banco = WUCListadoCuentasBancarias1.CuentasSeleccionadas[i].Descripcion.ToString().Substring(0, 20).TrimEnd(); string numerocuenta = WUCListadoCuentasBancarias1.CuentasSeleccionadas[i].Descripcion.ToString().Substring(WUCListadoCuentasBancarias1.CuentasSeleccionadas[i].Descripcion.ToString().Length - 20).TrimStart(); lstDetalle = informeBancario.consultaReporteEstadoCuentaConciliado(conexion, fechaInicio, fechaFin, banco, numerocuenta, DrpEstatusConcepto.SelectedValue == "0" ? "" : DrpEstatusConcepto.SelectedValue, DrpEstatus.SelectedValue == "0" ? "" : DrpEstatus.SelectedValue); ExportadorInformeEstadoCuentaConciliado obExportador = new ExportadorInformeEstadoCuentaConciliado(lstDetalle, HttpRuntime.AppDomainAppPath + @"InformesExcel\", "EdoCtaCon" + cero + fechaInicio.Month + fechaInicio.Year + ".xlsx", numerocuenta, banco, esfinal, ""); obExportador.FechaMesEncabezado = fechaInicio.ToString(); obExportador.generarInforme(); if (lstDetalle.Count > 0) { ScriptManager.RegisterStartupScript(this, typeof(Page), "UpdateMsg", @"alertify.alert('Conciliación bancaria','Informe generado con éxito!', function(){document.getElementById('LigaDescarga').click(); });", true); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "UpdateMsg", @"alertify.alert('Conciliación bancaria','No existen datos en el periodo seleccionado.', function(){ alertify.error('Error en la solicitud'); });", true); } } contador = contador + 1; } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "UpdateMsg", @"alertify.alert('Conciliación bancaria','Error: " + "Seleccione una cuenta bancaria" + "', function(){ alertify.error('Error en la solicitud'); });", true); } } catch (Exception ex) { // objApp.ImplementadorMensajes.MostrarMensaje(ex.Message); ScriptManager.RegisterStartupScript(this, typeof(Page), "UpdateMsg", @"alertify.alert('Conciliación bancaria','Error: " + ex.Message + "', function(){ alertify.error('Error en la solicitud'); });", true); } }