示例#1
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;
        }
示例#2
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;
        }