Ejemplo n.º 1
0
        public void changeStock(int idp, int cant)
        {
            BR.Productos other = db.Productos.Where(x => x.idProducto == idp).FirstOrDefault();

            other.stock = cant;

            db.SaveChanges();
        }
Ejemplo n.º 2
0
        public EN.Producto GetProducto(string nombreProducto)
        {
            EN.Producto  p     = new EN.Producto();
            BR.Productos other = db.Productos.Where(x => x.nombreProducto == nombreProducto).FirstOrDefault();

            p.Categoria      = other.Categoria.nombreCat;
            p.idCategoria    = other.idCategoria;
            p.idProducto     = other.idProducto;
            p.idProvedor     = other.Provedores.nombreProv;
            p.nombreProducto = other.nombreProducto;
            p.img            = other.img;
            p.Precio         = other.Precio;
            p.stock          = other.stock;

            return(p);
        }