public void GuardarHistorial(CuentaPorPagar cuentaPorPagar) { string mensaje = string.Format("Se guardó el historial de la CxP: Id = {0}, Importe = {1}, Naturaleza = {2}", cuentaPorPagar.Id.ToString(), cuentaPorPagar.Importe.ToString(), Enum.GetName(typeof(Naturaleza), cuentaPorPagar.Naturaleza)); Console.WriteLine(mensaje); }
//metodo con todos los filtros #region MostrarListadoCuentasPorPagar todos los filtros public List <CuentaPorPagar> ListaCuentasPorPagarTodosFiltros(string proveedor, string fechaInicio, string fechaFin, string tipoDeuda) { { // instancio un objeto conexion y otro Sqlcommand para la BD ConexionDAOS conex = new ConexionDAOS(); SqlCommand command = new SqlCommand(); SqlDataReader reader = null; List <CuentaPorPagar> listaCuentasPorPagar = new List <CuentaPorPagar>(); try { conex.AbrirConexion(); command.Connection = conex.ObjetoConexion(); command.CommandType = System.Data.CommandType.StoredProcedure; // Aqui debo poner el nombre del storeProcedure que no esta hecho command.CommandText = "[dbo].[ConsultarCuentasPorPagarFechasProveedor]"; command.CommandTimeout = 10; //Aqui van los parametros del store procesure command.Parameters.AddWithValue("@proveedor", proveedor); command.Parameters.AddWithValue("@fechaInicio", fechaInicio); command.Parameters.AddWithValue("@fechaFin", fechaFin); command.Parameters.AddWithValue("@tipoDeuda", tipoDeuda); //Se indica que es un parametro de entrada command.Parameters["@Proveedor"].Direction = ParameterDirection.Input; command.Parameters["@fechaInicio"].Direction = ParameterDirection.Input; command.Parameters["@fechaFin"].Direction = ParameterDirection.Input; command.Parameters["@tipoDeuda"].Direction = ParameterDirection.Input; reader = command.ExecuteReader(); // guarda registro a registro cada objeto de tipo cuentaPorPagar while (reader.Read()) { CuentaPorPagar cuentaPP = new CuentaPorPagar(); cuentaPP.IdCuentaPorPagar = reader.GetString(3); cuentaPP.FechaEmision = String.Format("{0:yyyy/MM/dd}", reader.GetDateTime(1)); cuentaPP.FechaVencimiento = String.Format("{0:yyyy/MM/dd}", reader.GetDateTime(2)); cuentaPP.MontoActualDeuda = reader.GetInt32(0); //Lleno la lista de cuentas por pagar listaCuentasPorPagar.Add(cuentaPP); } return(listaCuentasPorPagar); } catch (SqlException) { throw new Exception(); } finally { if (reader != null) { reader.Close(); } conex.CerrarConexion(); } } }
public void EnviarCorreo(CuentaPorPagar cuentaPorPagar) { string mensaje = string.Format("Se envío un correo para la CxP: Id = {0}, Importe = {1}, Naturaleza = {2}", cuentaPorPagar.Id.ToString(), cuentaPorPagar.Importe.ToString(), Enum.GetName(typeof(Naturaleza), cuentaPorPagar.Naturaleza)); Console.WriteLine(mensaje); }
public void testConsultarCuentaPorPagar() { string idCuentaPorPagar = "1"; Proveedor miProveedor = new Proveedor(); miProveedor.Nombre = "Hiperdental"; NumeroCuentaBanco miCuentaBanco = new NumeroCuentaBanco(); miCuentaBanco.NroCuentaBanco = "847384001"; Abono miAbono = new Abono(); List <Abono> listaAbono = new List <Abono>(); listaAbono.Add(miAbono); Empleado miEmpleado = new Empleado(); Entidad miCuentaPP = new CuentaPorPagar("1", "2009/02/02", "2011/03/03", "credito", "activo", "proveedor ", "detallazo", 222, 0, miProveedor, miEmpleado, miCuentaBanco, listaAbono); DAOCuentasPorPagar SqlCuentaPP = new DAOCuentasPorPagar(); Entidad otraCuenta = new CuentaPorPagar(); otraCuenta = SqlCuentaPP.ConsultarCuentaPorPagar(idCuentaPorPagar); Assert.IsNotNull(otraCuenta); Assert.AreEqual(otraCuenta, miCuentaPP); }
public void pruebaConstructor1() { CuentaPorPagar _cpp = new CuentaPorPagar("idCuentaPorPagar","fechaEmision",10000); Assert.IsNotNull(_cpp); Assert.AreEqual("idCuentaPorPagar", _cpp.IdCuentaPorPagar); Assert.AreEqual("fechaEmision", _cpp.FechaEmision); Assert.AreEqual(10000, _cpp.MontoActualDeuda); }
public void pruebaConstructor1() { CuentaPorPagar _cpp = new CuentaPorPagar("idCuentaPorPagar", "fechaEmision", 10000); Assert.IsNotNull(_cpp); Assert.AreEqual("idCuentaPorPagar", _cpp.IdCuentaPorPagar); Assert.AreEqual("fechaEmision", _cpp.FechaEmision); Assert.AreEqual(10000, _cpp.MontoActualDeuda); }
public void TestllenarAbonarCpp2() { string nombreProveedor = "HiperDental"; Int64 codigoCuenta = 2; DAOCuentasPorPagar SqlCuentaPP = new DAOCuentasPorPagar(); Entidades.EEntidad.Entidad miCuentaPP = new CuentaPorPagar(); miCuentaPP = SqlCuentaPP.llenarAbonarCpp2(nombreProveedor, codigoCuenta); Assert.IsNotNull(miCuentaPP); }
private async void LoadCuentasPorPagar() { this.IsRefreshing = true; //========================Validacion de la conexion al internet y el servidor=============================================================== var connection = await this.apiService.CheckConnection(); if (!connection.IsSuccess) { this.IsRefreshing = false; // "No se pudo conectar el servidor") if (connection.Result.ToString() == "No se pudo conectar el servidor") { await Application.Current.MainPage.DisplayAlert(Languages.Error, Languages.NoServer, Languages.Accept); System.Diagnostics.Process.GetCurrentProcess().CloseMainWindow(); } else { Device.BeginInvokeOnMainThread(async() => { await Application.Current.MainPage.DisplayAlert(Languages.Error, Languages.TurnOnInternet, Languages.Accept); }); CerrarPrograma(); return; } } //========================fin de la conexion al internet y el servidor====================================================================== var url = Application.Current.Resources["UrlAPI"].ToString(); var prefix = Application.Current.Resources["UrlPrefix"].ToString(); var controller = Application.Current.Resources["UrlCxpController"].ToString(); string id = $"{"/"}{App.IdActual}"; var response = await this.apiService.GetList <CuentasPorPagar>(url, prefix, controller, id); if (!response.IsSuccess) { this.IsRefreshing = false; await Application.Current.MainPage.DisplayAlert(Languages.Error, Languages.NoServer, Languages.Accept); return; } MainViewModel.GetInstance().CxPList = (List <CuentasPorPagar>)response.Result; this.CuentaPorPagar = new ObservableCollection <CuentasPorPagarItemViewModel>(this.ToCxPItemViewModel()); this.DebitoSum = (decimal)CuentaPorPagar.Where(x => x.SuplidorID == App.IdActual).Sum(p => p.Debito); this.CreditoSum = (decimal)CuentaPorPagar.Where(x => x.SuplidorID == App.IdActual).Sum(p => p.Credito); CultureInfo cultureInfo = new CultureInfo("es-DO"); this.Balance = string.Format(cultureInfo, "{0:C0}", this.DebitoSum - this.CreditoSum); this.IsRefreshing = false; }
/// <summary> /// Llenado del Dropdownlist de RAZON SOCIAL. /// </summary> protected List <CuentaPorPagar> GetData() { List <CuentaPorPagar> datos = new List <CuentaPorPagar>(); for (int i = 1; i <= 9; i++) { CuentaPorPagar dato = new CuentaPorPagar("CuentasPorPagar" + i, "CuentasPorPagar" + i, i); datos.Add(dato); } return(datos); }
public async Task <ICollection <DetalleLiquidacionParaArchivo> > ObtenerListaDetalleLiquidacionParaArchivo(List <int> listaLiquidacionId, int pciId) { List <DetalleLiquidacionParaArchivo> listaFinal = new List <DetalleLiquidacionParaArchivo>(); string identificacionPCI = string.Empty; var pci = await _listaRepository.ObtenerPci(pciId); if (pci != null) { identificacionPCI = pci.Identificacion; } var lista = await(from dl in _context.DetalleLiquidacion join t in _context.Tercero on dl.TerceroId equals t.TerceroId join p in _context.ParametroLiquidacionTercero on dl.TerceroId equals p.TerceroId into parametroLiquidacion from pl in parametroLiquidacion.DefaultIfEmpty() join tc in _context.TipoCuentaXPagar on pl.TipoCuentaXPagarId equals tc.TipoCuentaXPagarId into CuentaPorPagar from tiCu in CuentaPorPagar.DefaultIfEmpty() join tds in _context.TipoDocumentoSoporte on pl.TipoDocumentoSoporteId equals tds.TipoDocumentoSoporteId into DocumentoSoporte from tipoDocu in DocumentoSoporte.DefaultIfEmpty() where dl.PciId == pl.PciId where (listaLiquidacionId.Contains(dl.DetalleLiquidacionId)) where dl.PciId == pciId where (dl.Procesado == false) select new DetalleLiquidacionParaArchivo() { PCI = identificacionPCI, FechaActual = System.DateTime.Now.ToString("yyyy-MM-dd"), TipoIdentificacion = t.TipoIdentificacion, NumeroIdentificacion = t.NumeroIdentificacion, Crp = dl.Crp, TipoCuentaXPagarCodigo = pl.TipoCuentaXPagarId > 0 ? tiCu.Codigo : string.Empty, TotalACancelar = decimal.Round(dl.TotalACancelar, 2, MidpointRounding.AwayFromZero), ValorIva = decimal.Round(dl.ValorIva, 2, MidpointRounding.AwayFromZero), TextoComprobanteContable = dl.TextoComprobanteContable.Length > 220 ? dl.TextoComprobanteContable.Substring(0, 220) : dl.TextoComprobanteContable, TipoDocumentoSoporteCodigo = pl.TipoDocumentoSoporteId > 0 ? tipoDocu.Codigo : string.Empty, NumeroFactura = dl.NumeroFactura, ConstanteNumero = "16", NombreSupervisor = dl.NombreSupervisor, ConstanteCargo = "CargoSupervisor", FechaRegistro = dl.FechaRegistro.Value }) .ToListAsync(); if (lista != null && lista.Count > 0) { listaFinal = lista.OrderBy(x => x.FechaRegistro).ToList(); } return(listaFinal); }
public async Task <ICollection <DetalleLiquidacionParaArchivo> > ObtenerCabeceraParaArchivoObligacion(List <int> listaLiquidacionId, int pciId) { List <DetalleLiquidacionParaArchivo> listaFinal = new List <DetalleLiquidacionParaArchivo>(); string identificacionPCI = string.Empty; var pci = await _listaRepository.ObtenerPci(pciId); if (pci != null) { identificacionPCI = pci.Identificacion; } var lista = await(from dl in _context.DetalleLiquidacion join t in _context.Tercero on dl.TerceroId equals t.TerceroId join p in _context.ParametroLiquidacionTercero on dl.TerceroId equals p.TerceroId into parametroLiquidacion from pl in parametroLiquidacion.DefaultIfEmpty() join tc in _context.TipoCuentaXPagar on pl.TipoCuentaXPagarId equals tc.TipoCuentaXPagarId into CuentaPorPagar from tiCu in CuentaPorPagar.DefaultIfEmpty() join td in _context.TipoDocumentoSoporte on pl.TipoDocumentoSoporteId equals td.TipoDocumentoSoporteId into TipoDocumento from tiDo in TipoDocumento.DefaultIfEmpty() where dl.PciId == pl.PciId where (listaLiquidacionId.Contains(dl.DetalleLiquidacionId)) select new DetalleLiquidacionParaArchivo() { FechaActual = System.DateTime.Now.ToString("yyyy/MM/dd"), PCI = identificacionPCI, Crp = dl.Crp, Dip = "NO", TipoCuentaXPagarCodigo = pl.TipoCuentaXPagarId > 0 ? tiCu.Codigo : string.Empty, ValorIva = decimal.Round(dl.ValorIva, 2, MidpointRounding.AwayFromZero), TipoDocumentoSoporteCodigo = pl.TipoDocumentoSoporteId > 0 ? tiDo.Codigo : string.Empty, NumeroFactura = dl.NumeroFactura, ConstanteExpedidor = "11", ConstanteCargo = "SUPERVISOR", NombreSupervisor = dl.NombreSupervisor, TextoComprobanteContable = dl.TextoComprobanteContable.Length > 220 ? dl.TextoComprobanteContable.Substring(0, 220) : dl.TextoComprobanteContable, ValorTotal = decimal.Round(dl.ValorTotal, 2, MidpointRounding.AwayFromZero), FechaRegistro = dl.FechaRegistro.Value, }) .ToListAsync(); if (lista != null && lista.Count > 0) { listaFinal = lista.OrderBy(x => x.FechaRegistro).ToList(); } return(listaFinal); }
static void Main(string[] args) { CuentaPorPagar cuentaPorPagar = new CuentaPorPagar() { Id = Guid.NewGuid().ToString(), Importe = 3726.22, Descripcion = "Alguna descripción de la CxP" }; DefaultServiceCxP defaultServiceCxP = new DefaultServiceCxP(); HistorialGuardadoCxP historialGuardadoCxP = new HistorialGuardadoCxP(defaultServiceCxP); NotificacionCxP notificacionCxP = new NotificacionCxP(historialGuardadoCxP); notificacionCxP.GuardarCxP(cuentaPorPagar); Console.ReadLine(); }
public async Task <ICollection <ParametroLiquidacionTerceroDto> > ObtenerListaParametroLiquidacionTerceroTotal(int pciId) { var listaInicial = await(from pl in _context.ParametroLiquidacionTercero join t in _context.Tercero on pl.TerceroId equals t.TerceroId join tmc in _context.TipoModalidadContrato on pl.ModalidadContrato equals tmc.TipoModalidadContratoId join tds in _context.TipoDocumentoSoporte on pl.TipoDocumentoSoporteId equals tds.TipoDocumentoSoporteId into DocumentoSoporte from tipoDocu in DocumentoSoporte.DefaultIfEmpty() join tc in _context.TipoCuentaXPagar on pl.TipoCuentaXPagarId equals tc.TipoCuentaXPagarId into CuentaPorPagar from tiCu in CuentaPorPagar.DefaultIfEmpty() where pl.PciId == pciId select new ParametroLiquidacionTerceroDto() { IdentificacionTercero = t.NumeroIdentificacion, NombreTercero = t.Nombre, ModalidadContratoDescripcion = tmc.Nombre, TipoDocumentoSoporteDescripcion = pl.TipoDocumentoSoporteId > 0 ? tipoDocu.Nombre : string.Empty, TipoCuentaPorPagarDescripcion = pl.TipoCuentaXPagarId > 0 ? tiCu.Nombre : string.Empty, HonorarioSinIva = pl.HonorarioSinIva, BaseAporteSalud = pl.BaseAporteSalud, AporteSalud = pl.AporteSalud, AportePension = pl.AportePension, RiesgoLaboral = pl.RiesgoLaboral, FondoSolidaridad = pl.FondoSolidaridad, PensionVoluntaria = pl.PensionVoluntaria, Dependiente = pl.Dependiente, Afc = pl.Afc, MedicinaPrepagada = pl.MedicinaPrepagada, InteresVivienda = pl.InteresVivienda, FechaInicioDescuentoInteresVivienda = pl.FechaInicioDescuentoInteresVivienda, FechaFinalDescuentoInteresVivienda = pl.FechaFinalDescuentoInteresVivienda, TarifaIva = pl.TarifaIva, FacturaElectronicaDescripcion = pl.FacturaElectronica ? "SI" : "NO" }) .Distinct() .OrderBy(c => c.NombreTercero) .ToListAsync(); return(listaInicial); }
public void TestActivarDesactivarCpp() { Proveedor miProveedor = new Proveedor(); miProveedor.Nombre = "Hiperdental"; NumeroCuentaBanco miCuentaBanco = new NumeroCuentaBanco(); miCuentaBanco.NroCuentaBanco = "847384001"; Abono miAbono = new Abono(); List<Abono> listaAbono = new List<Abono>(); listaAbono.Add(miAbono); Empleado miEmpleado = new Empleado(); CuentaPorPagar miCuentaPP = new CuentaPorPagar("1", "2009/02/02", "2011/03/03", "contado", "activo", "proveedor ", "detallito", 222, 222, miProveedor, miEmpleado, miCuentaBanco, listaAbono); DAOCuentasPorPagar SqlCuentaPP = new DAOCuentasPorPagar(); bool Activo = SqlCuentaPP.ActivarDesactivarCpp(miCuentaPP); Assert.IsTrue(Activo); }
public void pruebaConstructor2() { Proveedor miProveedor = new Proveedor(); Empleado miEmpleado = new Empleado(); NumeroCuentaBanco numeroCuentaBanco = new NumeroCuentaBanco(); List<Abono> listaAbono=new List<Abono>(); CuentaPorPagar _cpp = new CuentaPorPagar("idCuentaPorPagar", "fechaEmision","fechaEmision","","","","", 10000,1,miProveedor,miEmpleado,numeroCuentaBanco,listaAbono); Assert.IsNotNull(_cpp); Assert.AreEqual("idCuentaPorPagar", _cpp.IdCuentaPorPagar); Assert.AreEqual("fechaEmision", _cpp.FechaEmision); Assert.AreEqual("fechaEmision", _cpp.FechaVencimiento); Assert.AreEqual("", _cpp.TipoPago); Assert.AreEqual("", _cpp.Estatus); Assert.AreEqual("", _cpp.TipoDeuda); Assert.AreEqual("", _cpp.Detalle); Assert.AreEqual(10000, _cpp.MontoInicialDeuda); Assert.AreEqual(1, _cpp.MontoActualDeuda); Assert.AreEqual(listaAbono, _cpp.ListaAbono); }
public void pruebaConstructor2() { Proveedor miProveedor = new Proveedor(); Empleado miEmpleado = new Empleado(); NumeroCuentaBanco numeroCuentaBanco = new NumeroCuentaBanco(); List <Abono> listaAbono = new List <Abono>(); CuentaPorPagar _cpp = new CuentaPorPagar("idCuentaPorPagar", "fechaEmision", "fechaEmision", "", "", "", "", 10000, 1, miProveedor, miEmpleado, numeroCuentaBanco, listaAbono); Assert.IsNotNull(_cpp); Assert.AreEqual("idCuentaPorPagar", _cpp.IdCuentaPorPagar); Assert.AreEqual("fechaEmision", _cpp.FechaEmision); Assert.AreEqual("fechaEmision", _cpp.FechaVencimiento); Assert.AreEqual("", _cpp.TipoPago); Assert.AreEqual("", _cpp.Estatus); Assert.AreEqual("", _cpp.TipoDeuda); Assert.AreEqual("", _cpp.Detalle); Assert.AreEqual(10000, _cpp.MontoInicialDeuda); Assert.AreEqual(1, _cpp.MontoActualDeuda); Assert.AreEqual(listaAbono, _cpp.ListaAbono); }
public void TestActivarDesactivarCpp() { Proveedor miProveedor = new Proveedor(); miProveedor.Nombre = "Hiperdental"; NumeroCuentaBanco miCuentaBanco = new NumeroCuentaBanco(); miCuentaBanco.NroCuentaBanco = "847384001"; Abono miAbono = new Abono(); List <Abono> listaAbono = new List <Abono>(); listaAbono.Add(miAbono); Empleado miEmpleado = new Empleado(); CuentaPorPagar miCuentaPP = new CuentaPorPagar("1", "2009/02/02", "2011/03/03", "contado", "activo", "proveedor ", "detallito", 222, 222, miProveedor, miEmpleado, miCuentaBanco, listaAbono); DAOCuentasPorPagar SqlCuentaPP = new DAOCuentasPorPagar(); bool Activo = SqlCuentaPP.ActivarDesactivarCpp(miCuentaPP); Assert.IsTrue(Activo); }
public void testConsultarCuentaPorPagar() { string idCuentaPorPagar = "1"; Proveedor miProveedor = new Proveedor(); miProveedor.Nombre = "Hiperdental"; NumeroCuentaBanco miCuentaBanco = new NumeroCuentaBanco(); miCuentaBanco.NroCuentaBanco = "847384001"; Abono miAbono = new Abono(); List<Abono> listaAbono = new List<Abono>(); listaAbono.Add(miAbono); Empleado miEmpleado = new Empleado(); Entidad miCuentaPP = new CuentaPorPagar("1", "2009/02/02", "2011/03/03", "credito", "activo", "proveedor ", "detallazo", 222, 0, miProveedor, miEmpleado, miCuentaBanco, listaAbono); DAOCuentasPorPagar SqlCuentaPP = new DAOCuentasPorPagar(); Entidad otraCuenta = new CuentaPorPagar(); otraCuenta = SqlCuentaPP.ConsultarCuentaPorPagar(idCuentaPorPagar); Assert.IsNotNull(otraCuenta); Assert.AreEqual(otraCuenta, miCuentaPP); }
public void SendMail(CuentaPorPagar cuentaPorPagar) { _mailService.Send("destino", string.Format("se creó la cuenta {0} con importe {1}", cuentaPorPagar.Id, cuentaPorPagar.Importe)); }
public void SendMail(CuentaPorPagar cuentaPorPagar) { _emailDecorator.SendMail(cuentaPorPagar); }
public void SaveCxP(CuentaPorPagar cuentaPorPagar) { _servicioPrincipal.SaveCxP(cuentaPorPagar); SendMail(cuentaPorPagar); }
public void SaveCxP(CuentaPorPagar cuentaPorPagar) { _decoradorPrincipal.SaveCxP(cuentaPorPagar); SendMail(cuentaPorPagar); }
public void SaveCxP(CuentaPorPagar cuentaPorPagar) { _repo.Add(cuentaPorPagar); }
public void GuardarCxP(CuentaPorPagar cuentaPorPagar) { _guardarService.GuardarCxP(cuentaPorPagar); EnviarCorreo(cuentaPorPagar); }
public void GuardarCxP(CuentaPorPagar cuentaPorPagar) { _guardarService.GuardarCxP(cuentaPorPagar); GuardarHistorial(cuentaPorPagar); }
/// <summary> /// Llenado del Dropdownlist de RAZON SOCIAL. /// </summary> protected List<CuentaPorPagar> GetData() { List<CuentaPorPagar> datos = new List<CuentaPorPagar>(); for (int i = 1; i <= 9; i++) { CuentaPorPagar dato = new CuentaPorPagar("CuentasPorPagar" + i, "CuentasPorPagar" + i, i); datos.Add(dato); } return datos; }
public List<CuentaPorPagar> ListaCuentasPorPagarTodosFiltros(string proveedor, string fechaInicio, string fechaFin, string tipoDeuda) { { // instancio un objeto conexion y otro Sqlcommand para la BD ConexionDAOS conex = new ConexionDAOS(); SqlCommand command = new SqlCommand(); SqlDataReader reader = null; List<CuentaPorPagar> listaCuentasPorPagar = new List<CuentaPorPagar>(); try { conex.AbrirConexion(); command.Connection = conex.ObjetoConexion(); command.CommandType = System.Data.CommandType.StoredProcedure; // Aqui debo poner el nombre del storeProcedure que no esta hecho command.CommandText = "[dbo].[ConsultarCuentasPorPagarFechasProveedor]"; command.CommandTimeout = 10; //Aqui van los parametros del store procesure command.Parameters.AddWithValue("@proveedor", proveedor); command.Parameters.AddWithValue("@fechaInicio", fechaInicio); command.Parameters.AddWithValue("@fechaFin", fechaFin); command.Parameters.AddWithValue("@tipoDeuda", tipoDeuda); //Se indica que es un parametro de entrada command.Parameters["@Proveedor"].Direction = ParameterDirection.Input; command.Parameters["@fechaInicio"].Direction = ParameterDirection.Input; command.Parameters["@fechaFin"].Direction = ParameterDirection.Input; command.Parameters["@tipoDeuda"].Direction = ParameterDirection.Input; reader = command.ExecuteReader(); // guarda registro a registro cada objeto de tipo cuentaPorPagar while (reader.Read()) { CuentaPorPagar cuentaPP = new CuentaPorPagar(); cuentaPP.IdCuentaPorPagar = reader.GetString(3); cuentaPP.FechaEmision = String.Format("{0:yyyy/MM/dd}", reader.GetDateTime(1)); cuentaPP.FechaVencimiento = String.Format("{0:yyyy/MM/dd}", reader.GetDateTime(2)); cuentaPP.MontoActualDeuda = reader.GetInt32(0); //Lleno la lista de cuentas por pagar listaCuentasPorPagar.Add(cuentaPP); } return listaCuentasPorPagar; } catch (SqlException) { throw new Exception(); } finally { if (reader != null) reader.Close(); conex.CerrarConexion(); } } }