Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }