예제 #1
0
 public void Close(Venta p)
 {
     VentasDao dao = new VentasDao();
     if (dao.Close(p) != 1)
     {
         throw new Exception("No se cerró la venta");
     }
 }
예제 #2
0
 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");
     }
 }
예제 #3
0
 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;
     }
 }
예제 #4
0
 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;
     }
 }
예제 #5
0
 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;
     }
 }
예제 #6
0
        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)
                    }
                }
            };
        }
예제 #7
0
 public void Insert(Venta p)
 {
     VentasDao dao = new VentasDao();
     if (dao.Insert(p) != 1)
     {
         throw new Exception("No se insertó la información");
     }
 }
예제 #8
0
 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");
     }
 }
예제 #9
0
 static VentasBussines()
 {
     ventasDao = new VentasDao();
 }