public void SetProduct() { var db = new BusinessEntities(); if (this.Product == null) { this.Product = db.Products.Find(this.product_id); } db.Dispose(); }
private void SetProductInventory(int productInventoryID) { var db = new BusinessEntities(); this.product_inventory_id = productInventoryID; this.ProductInventory = db.Product_Inventory.Find(productInventoryID); this.ProductInventory.CalculatePackage(); this.ProductInventory.SetProduct(); db.Dispose(); }