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 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); }