private void CreateFoodLogEntry(FitnessTrackerPlus.Web.Data.Food food) { FoodLogEntry entry = new FoodLogEntry(); ProgressBar.Visibility = Visibility.Visible; // Setup new food log entry with selected date, food and current user entry.food_id = food.id; entry.entry_date = Globals.SelectedDate; entry.user_id = Globals.CurrentUser.id; entry.servings = 1; context.FoodLogEntries.Add(entry); context.SubmitChanges((ChangesSubmitted) => { ProgressBar.Visibility = Visibility.Collapsed; LoadFoodLog(); }, null); }
public CustomFoodCreatedEventArgs(FitnessTrackerPlus.Web.Data.Food custom_food) { this.custom_food = custom_food; }