Example #1
0
        public static void InsertarProducto(productos P)
        {
            Repo = new ProductosRepository();

            Repo.Insert(P);

            Repo.SubmitChanges();
        }
Example #2
0
        public static void EliminarProducto(productos P)
        {
            Repo = new ProductosRepository();

            Repo.Delete(P);

            Repo.SubmitChanges();
        }
Example #3
0
        public static IQueryable <productos> ObtenerProductoPorCategoria(string categoria)

        {
            Repo = new ProductosRepository();

            return(from p in Repo.GetTable()
                   where p.Categoria == categoria
                   select p);
        }
Example #4
0
        public static Double ObtenerPrecioPorCategoria(string categoria)

        {
            Repo = new ProductosRepository();
            var producto = new productos();

            producto = (from p in Repo.GetTable() where p.Categoria == categoria select p).FirstOrDefault();

            return(producto.Precio);
        }