public bool Save(FoodItem selectedFoodItem) { hasError = false; try { sqlFoodItem f = new sqlFoodItem(selectedFoodItem); FoodItemLINQDataContext dc = new FoodItemLINQDataContext(); dc.UpdateFoodItem(selectedFoodItem.FoodName, selectedFoodItem.ItemPrice, selectedFoodItem.Id); } catch (Exception ex) { errorMessage = "Update error, " + ex.Message; hasError = true; } return (!hasError); }
public void CopyProduct(FoodItem f) { this.Id = f.Id; this.FoodName = f.FoodName; this.ItemPrice = f.ItemPrice; }
public sqlFoodItem(FoodItem f) { Id = f.Id; FoodName = f.FoodName; ItemPrice = f.ItemPrice; }