Example #1
0
        public void update(product editItem)
        {
            product selectedItem = db.products.SingleOrDefault(item => item.id == editItem.id);
            selectedItem.code = editItem.code;
            selectedItem.name = editItem.name;
            selectedItem.receiptdescription = editItem.receiptdescription;
            selectedItem.status = editItem.status;
            selectedItem.prepproduct = editItem.prepproduct;
            selectedItem.preplocation = editItem.preplocation;
            selectedItem.buyingprice = editItem.buyingprice;
            selectedItem.dineinprice = editItem.dineinprice;
            selectedItem.collectionprice = editItem.collectionprice;
            selectedItem.waitingprice = editItem.waitingprice;
            selectedItem.deliveryprice = editItem.deliveryprice;
            selectedItem.allprice = editItem.allprice;
            selectedItem.stockproduct = editItem.stockproduct;
            selectedItem.stockquantity = editItem.stockquantity;
            selectedItem.discountable = editItem.discountable;
            selectedItem.popupmessage = editItem.popupmessage;
            selectedItem.lookupcode = editItem.lookupcode;
            selectedItem.receiptcopies = editItem.receiptcopies;
            selectedItem.productcategory_id = editItem.productcategory_id;
            selectedItem.menu_id = editItem.menu_id;

            db.SaveChanges();
        }
Example #2
0
 public void insert(product newItem)
 {
     db.products.Add(newItem);
     db.SaveChanges();
 }
Example #3
0
        public product selectSingle(product findItem)
        {
            product selectedItem = db.products.SingleOrDefault(item => item.id == findItem.id);

            return selectedItem;
        }
Example #4
0
 public void delete(product deleteItem)
 {
     product selectedItem = db.products.First(item => item.id == deleteItem.id);
     db.products.Remove(selectedItem);
     db.SaveChanges();
 }