示例#1
0
        public List<FacturaDetalleDto> ListaFacturaDetalles(int idFactura)
        {
            var gestorFactura = new GestorFacturas();
            var lista = gestorFactura.ListarDetalle(idFactura);
            var listaDtos = new List<FacturaDetalleDto>();

            foreach (var detalle in lista)
            {
                var dto = new FacturaDetalleDto();
                dto.Id = detalle.Id;
                dto.NroFactura = detalle.Factura.NroFactura;
                dto.IdProducto = detalle.Producto.Id;
                dto.NombreProducto = detalle.Producto.Nombre;
                dto.PrecioVentaProducto = detalle.Producto.PrecioListaVenta;
                dto.EstadoProducto = detalle.Producto.Estado;
                dto.FechaFactura = detalle.Factura.FechaFactura;
                listaDtos.Add(dto);
            }

            return listaDtos;
        }
示例#2
0
        public List<FacturaDto> ListaFacturas()
        {
            var gestorFactura = new GestorFacturas();
            var lista = gestorFactura.Listar();
            var listaDtos = new List<FacturaDto>();

            foreach (var factura in lista)
            {
                var dto = new FacturaDto();
                dto.Id = factura.FacturaId;
                dto.NroFactura = factura.NumeroFact.ToString();
                dto.FechaFactura = factura.FechaEmision;
                dto.ValorVenta = factura.ValorVenta;
                dto.PrecioVenta = (double) (factura.MontoIGV + (decimal) factura.ValorVenta);
                dto.Estado = factura.EstadoFacturacion;
                dto.NombreCompletoCliente = factura.TB_VT_Clientes.ApellidoPaterno.Trim() + "," + factura.TB_VT_Clientes.PrimerNombre.Trim();
                listaDtos.Add(dto);
            }

            return listaDtos;
        }
示例#3
0
        public List<FacturaDetalleDto> ListaFacturaDetalles(int idFactura)
        {
            var gestorFactura = new GestorFacturas();
            var lista = gestorFactura.ListarDetalle(idFactura);
            var listaDtos = new List<FacturaDetalleDto>();

            foreach (var detalle in lista)
            {
                var dto = new FacturaDetalleDto();
                dto.Id = detalle.FacturaDetalleId;
                dto.NroFactura = detalle.TB_VT_Facturas.NumeroFact.ToString();
                dto.IdProducto = detalle.TB_AL_Productos.ProductoId;
                dto.NombreProducto = detalle.TB_AL_Productos.Nombre;
                dto.PrecioVentaProducto = detalle.TB_AL_Productos.PrecioListaVenta;
                dto.EstadoProducto = detalle.TB_AL_Productos.Estado;
                dto.FechaFactura = detalle.TB_VT_Facturas.FechaEmision;
                listaDtos.Add(dto);
            }

            return listaDtos;
        }
示例#4
0
        public List<FacturaDto> ListaFacturas()
        {
            var gestorFactura = new GestorFacturas();
            var lista = gestorFactura.Listar();
            var listaDtos = new List<FacturaDto>();

            foreach (var factura in lista)
            {
                var dto = new FacturaDto();
                dto.Id = factura.Id;
                dto.NroFactura = factura.NroFactura;
                dto.FechaFactura = factura.FechaFactura;
                dto.ValorVenta = factura.ValorVenta;
                dto.PrecioVenta = factura.PrecioVenta;
                dto.Estado = factura.Estado;
                dto.NombreCompletoCliente = factura.Cliente.Apellidos + ", " + factura.Cliente.Nombres;

                listaDtos.Add(dto);
            }

            return listaDtos;
        }
示例#5
0
        public List<FacturaDetalleDto> ListarDetallePorNroFactura(string nroFactura, int nroPagina)
        {
            var gestorFactura = new GestorFacturas();
            var lista = gestorFactura.ListarDetallePorNroFactura(nroFactura, nroPagina);
            var listaDtos = new List<FacturaDetalleDto>();

            foreach (var detalle in lista)
            {
                var dto = new FacturaDetalleDto();
                dto.Id = detalle.Id;
                dto.NroFactura = detalle.Factura.NroFactura;
                dto.NombreCliente = detalle.Factura.Cliente.Apellidos + ", " + detalle.Factura.Cliente.Nombres;
                dto.IdProducto = detalle.Producto.Id;
                dto.NombreProducto = detalle.Producto.Nombre;
                dto.PrecioVentaProducto = detalle.Producto.PrecioListaVenta;
                dto.EstadoProducto = detalle.Producto.Estado;
                dto.FechaFactura = detalle.Factura.FechaFactura;

                listaDtos.Add(dto);
            }

            return listaDtos;
        }
示例#6
0
        public List<FacturaDetalleDto> ListarDetallePorNroFactura(string nroFactura, int nroPagina)
        {
            var gestorFactura = new GestorFacturas();
            var lista = gestorFactura.ListarDetallePorNroFactura(nroFactura, nroPagina);
            var listaDtos = new List<FacturaDetalleDto>();

            foreach (var detalle in lista)
            {
                var dto = new FacturaDetalleDto();
                dto.Id = detalle.FacturaDetalleId;
                dto.NroFactura = detalle.TB_VT_Facturas.NumeroFact;
                dto.NombreCliente = detalle.TB_VT_Facturas.TB_VT_Clientes.ApellidoPaterno.Trim() + ", " + detalle.TB_VT_Facturas.TB_VT_Clientes.PrimerNombre.Trim();
                dto.IdProducto = detalle.TB_AL_Productos.ProductoId;
                dto.NombreProducto = detalle.TB_AL_Productos.Nombre;
                dto.PrecioVentaProducto = detalle.TB_AL_Productos.PrecioListaVenta;
                dto.EstadoProducto = detalle.TB_AL_Productos.Estado;
                dto.FechaFactura = detalle.TB_VT_Facturas.FechaEmision;

                listaDtos.Add(dto);
            }

            return listaDtos;
        }
示例#7
0
 public FacturaDto ObtenerFactura(int idFactura)
 {
     var gestorFactura = new GestorFacturas();
     var factura = gestorFactura.ObtenerFactura(idFactura);
     var dto = new FacturaDto();
     try
     {
         if (factura == null)
         {
             throw new Exception("Factura no encontrada");
         }
         dto.Id = factura.Id;
         dto.NroFactura = factura.NroFactura;
         dto.FechaFactura = factura.FechaFactura;
         dto.ValorVenta = factura.ValorVenta;
         dto.PrecioVenta = factura.PrecioVenta;
         dto.Estado = factura.Estado;
         dto.NombreCompletoCliente = factura.Cliente.Apellidos + ", " + factura.Cliente.Nombres;
     }
     catch (Exception e)
     {
         //throw;
         Console.WriteLine("{0} Exception caught.", e.Message);
     }
     return dto;
 }
示例#8
0
 public List<int> NroPaginasPorDetalleNroFactura(string nroFactura)
 {
     var gestorFactura = new GestorFacturas();
     return gestorFactura.NroPaginasPorDetalleNroFactura(nroFactura);
 }
示例#9
0
        public FacturaDetalleDto ObtenerFacturaDetalle(int idDetalle)
        {
            var gestorFactura = new GestorFacturas();
            var detalle = gestorFactura.ObtenerDetalleFactura(idDetalle);
            var dto = new FacturaDetalleDto();
            try
            {
                dto.Id = detalle.Id;
                dto.NroFactura = detalle.Factura.NroFactura;
                dto.FechaFactura = detalle.Factura.FechaFactura;
                dto.IdProducto = detalle.Producto.Id;
                dto.NombreProducto = detalle.Producto.Nombre;
                dto.PrecioVentaProducto = detalle.Producto.PrecioListaVenta;
                dto.EstadoProducto = detalle.Producto.Estado;
            }
            catch (Exception e)
            {
                //throw;
                Console.WriteLine("{0} Exception caught.", e.Message);
            }

            return dto;
        }
示例#10
0
 public FacturaDto ObtenerFactura(int idFactura)
 {
     var gestorFactura = new GestorFacturas();
     var factura = gestorFactura.ObtenerFactura(idFactura);
     var dto = new FacturaDto();
     try
     {
         if (factura == null)
         {
             throw new Exception("Factura no encontrada");
         }
         dto.Id = factura.FacturaId;
         dto.NroFactura = factura.NumeroFact.ToString();
         dto.FechaFactura = factura.FechaEmision;
         dto.ValorVenta = factura.ValorVenta;
         dto.PrecioVenta = (double)(factura.MontoIGV + (decimal)factura.ValorVenta);
         dto.Estado = factura.EstadoFacturacion;
         dto.NombreCompletoCliente = factura.TB_VT_Clientes.ApellidoPaterno.Trim() + "," + factura.TB_VT_Clientes.PrimerNombre.Trim();
     }
     catch (Exception e)
     {
         //throw;
         Console.WriteLine("{0} Exception caught.", e.Message);
     }
     return dto;
 }