Пример #1
0
        public List <PRODUCT> GetAllProduct()
        {
            entity = new INVENTORYEntities();
            var lstPrd = entity.PRODUCTs.ToList();

            return(lstPrd);
        }
Пример #2
0
        public PRODUCT GetProdById(string pID)
        {
            entity = new INVENTORYEntities();
            PRODUCT prod = entity.PRODUCTs.Find(int.Parse(pID));

            return(prod);
        }
Пример #3
0
 public bool AddNewProduct(PRODUCT prod)
 {
     entity = new INVENTORYEntities();
     entity.PRODUCTs.Add(prod);
     entity.SaveChanges();
     return(true);
 }
Пример #4
0
        public bool DeleteProductByID(string pID)
        {
            entity = new INVENTORYEntities();
            PRODUCT prod = entity.PRODUCTs.Find(int.Parse(pID));

            entity.PRODUCTs.Remove(prod);
            entity.SaveChanges();
            return(true);
        }