private void RegisterShipment() { Product product = GetSelectedProduct(); frmEditShippment frmEditShippment = new frmEditShippment(product); if (frmEditShippment.ShowDialog() == DialogResult.OK) { using (var db = new StoreManagerContext()) { Product originalProduct = (from p in db.Products where p.ProductID == product.ProductID select p).Single(); originalProduct.Stock = product.Stock; db.SaveChanges(); } } }
private void RegisterShipment() { Product product = GetSelectedProduct(); frmEditShippment frmEditShippment = new frmEditShippment(product); if (frmEditShippment.ShowDialog() == DialogResult.OK) { using (var db = new StoreManagerContext()) { Product originalProduct = (from p in db.Products where p.ProductID == product.ProductID select p).Single(); originalProduct.Stock = product.Stock; db.SaveChanges(); } } }