public void Close(Venta p) { VentasDao dao = new VentasDao(); if (dao.Close(p) != 1) { throw new Exception("No se cerró la venta"); } }
public void AddPromo(UInt32 promo_id, UInt32 venta_id, float precio) { VentasDao dao = new VentasDao(); if (dao.AddPromo(promo_id, venta_id, precio) != 1) { throw new Exception("No se insertó la información"); } }
public IEnumerable<Pedido> GetPedidos(Venta v) { try { VentasDao dao = new VentasDao(); return dao.GetPedidos(v); } catch (Exception ex) { Console.WriteLine("Error al obtener pedidos: " + ex.Message); throw ex; } }
public Venta GetOne(UInt32 id) { try { VentasDao dao = new VentasDao(); return dao.GetOne(id); } catch (Exception ex) { Console.WriteLine("Error al obtener la venta: " + ex.Message); throw ex; } }
public IEnumerable<Venta> GetAbiertas() { try { VentasDao dao = new VentasDao(); return dao.GetAbiertas(); } catch (Exception ex) { Console.WriteLine("Error al obtener ventas en proceso: " + ex.Message); throw ex; } }
public void TestInitializer() { ventasDao = new VentasDao(); venta = new VentaDataModel() { Fecha = DateTime.Now, MontoTotal = 1000, DetalleVenta = new VentaDetalleDataModel() { Productos = new System.Collections.Generic.List <ProductoDetalleDataModel>() { new ProductoDetalleDataModel(1, "Test", 1000, 1, 1000) } } }; }
public void Insert(Venta p) { VentasDao dao = new VentasDao(); if (dao.Insert(p) != 1) { throw new Exception("No se insertó la información"); } }
public void RemovePedido(UInt32 pedido_id, UInt32 venta_id, float precio) { VentasDao dao = new VentasDao(); if (dao.RemovePedido(pedido_id, venta_id, precio) != 1) { throw new Exception("No se removió la información"); } }
static VentasBussines() { ventasDao = new VentasDao(); }