コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }