public void DeleteFoodEntry() // Deletes anything related to the FoodEntry. See Stored Procedure. { dbClass.DeleteFoodEntryFromDB_AtFoodEntryID(SelectedFoodEntryListItem.FoodEntryID.Value); FoodEntry currentFoodEntry = FoodEntryList.Where(tag => SelectedFoodEntryListItem.FoodEntryID.Value == tag.FoodEntryID).FirstOrDefault(); FoodEntryList.Remove(currentFoodEntry); }
public void DeleteFoodEntry_Tag() { FoodEntry currentFoodEntry = FoodEntryList.Where(tag => SelectedFoodEntryListItem.FoodEntryID.Value == tag.FoodEntryID).FirstOrDefault(); Tag currentTag = null; // TagViewModel.SubcategoryTagList.Where(tag => SelectedFoodEntry_TagListItem.TagID.Value == tag.TagID).FirstOrDefault(); dbClass.DeleteFoodEntry_TagFromDB_AtTagID((int)currentFoodEntry.FoodEntryID.Value, (int)currentTag.TagID.Value); currentFoodEntry.FoodEntry_TagList.Remove(currentTag); }
public void AddFoodEntry_Tag() { FoodEntry currentFoodEntry = FoodEntryList.Where(tag => SelectedFoodEntryListItem.FoodEntryID.Value == tag.FoodEntryID).FirstOrDefault(); Tag currentTag = null;//TagViewModel.SubcategoryTagList.Where(tag => TagViewModel.SelectedTagListItem.TagID.Value == tag.TagID).FirstOrDefault(); dbClass.InsertFoodEntry_TagToDB((int)currentFoodEntry.FoodEntryID, (int)currentTag.TagID.Value); currentFoodEntry.FoodEntry_TagList.Add(currentTag); }
public void AddNewFoodEntry() { DateTime dateTime = new DateTime(); dateTime = DateTime.Now; int newFoodEntryID = dbClass.InsertFoodEntryToDB(dateTime, NewEntryDescription, NewEntryIsFeelingGoodBad); FoodEntry newFoodEntry = new FoodEntry { FoodEntryID = newFoodEntryID, DateTime = dateTime, Description = NewEntryDescription, IsFeelingGoodBad = NewEntryIsFeelingGoodBad }; FoodEntryList.Add(newFoodEntry); }