Ejemplo n.º 1
0
        //------------------------------------------------------------BUSCARPRODUCTO-------------------------------------------------------------------//

        public List <Venta> SearchProduct(int search)
        {
            using (Clsbdcontext cl = new Clsbdcontext())
            {
                var query = (from x in cl.Venta where (x.Producto == search) select x).ToList();
                return(query);
            }
        }
Ejemplo n.º 2
0
 public List <Venta> TraerVentas(string fecha)
 {
     using (Clsbdcontext cl = new Clsbdcontext())
     {
         var query = (from x in cl.Venta where (x.Fecha == Convert.ToDateTime(fecha)) select x).ToList();
         return(query);
     }
 }
Ejemplo n.º 3
0
 public List <Producto> TraerProductos()
 {
     using (Clsbdcontext cl = new Clsbdcontext())
     {
         List <Producto> lista = (from x in cl.Producto select x).ToList();
         return(lista);
     }
 }
Ejemplo n.º 4
0
        //------------------------------------------------------------VENTAS-------------------------------------------------------------------//

        public void VentasdelDia(int cliente, int producto, DateTime fecha)
        {
            using (var contexto = new Clsbdcontext())
            {
                var venta = new Venta()
                {
                    Cliente  = cliente,
                    Producto = producto,
                    Fecha    = fecha
                };
                contexto.Venta.Add(venta);
                contexto.SaveChanges();
            }
        }
Ejemplo n.º 5
0
 //------------------------------------------------------------PRODUCTO-------------------------------------------------------------------//
 public void insertarProductos(string cod, string mar, string nom, decimal prec)
 {
     using (var contexto = new Clsbdcontext())
     {
         var productos = new Producto()
         {
             Codigo = cod,
             Marca  = mar,
             Nombre = nom,
             Precio = prec
         };
         contexto.Producto.Add(productos);
         contexto.SaveChanges();
     }
 }
Ejemplo n.º 6
0
        //------------------------------------------------------------CLIENTE-------------------------------------------------------------------//

        public void insertarCliente(string dni, string nombr, string apellido, string direccion, string telefono)
        {
            using (var contexto = new Clsbdcontext())
            {
                var clientes = new Cliente()
                {
                    Dni       = dni,
                    Nombre    = nombr,
                    Apellido  = apellido,
                    Direccion = direccion,
                    Telefono  = telefono
                };
                contexto.Cliente.Add(clientes);
                contexto.SaveChanges();
            }
        }