public Factura ObtenerPorId(int id) { SqlParameter[] sqlParameter = { new SqlParameter("idFactura", id) }; DataTable datos = sqlServerManejador.Ejecutar("SP.Factura_Obtener_Por_ID", sqlParameter); Factura factura = CargarDatos <Factura>(datos).FirstOrDefault();; IDetalleFacturaDAO detalle = DatosFactory.CrearDetalleFactura(); IMediosPagoFacturaDAO medioPago = DatosFactory.CrearMedioPagoFactura(); IProductoDAO productoDao = DatosFactory.CrearProductoDAO(); List <DetalleFactura> listaDetalle = detalle.ObtenerPorIdFactura(factura.IdFactura); List <DetalleFactura> listaDetalleAux = new List <DetalleFactura>(); foreach (DetalleFactura d in listaDetalle) { d.Producto = productoDao.ObtenerPorId(d.IdProducto); listaDetalleAux.Add(d); } factura.DetalleFacturas = listaDetalleAux; factura.MedioPagoFacturas = medioPago.ObtenerPorIdFactura(factura.IdFactura); factura.Codigo = Utilidades.UtilBD.GetMD5(factura.Codigo); return(factura); }
public GestionarProductoServicio() { productoDAO = new ProductoDAOSqlServer(); }
public ProductoServiceAppService(ProductoDAO ProductoDAO) { _ProductoRepositorio = ProductoDAO; }
public GestionarProductoServicio() { gestorODBC = new ConexionSqlServer(); productoDAO = new ProductoDAOSqlServer(gestorODBC); }
public ProductoBL(IProductoDAO producto, IRecetaDAO receta) { this._productoDAO = producto; this._recetaDAO = receta; }