示例#1
0
        public async void loadSelectedGoalsFromDbToday()
        {
            //Debug.WriteLine("###############  load goal today from db");
            SelectedGoals.Clear();
            var selectedGoalsInDb = selectedGoalDatabase.GetSelectedGoalsToday().Result;

            foreach (var selectedGoal in selectedGoalsInDb)
            {
                if (!selectedGoal.Status.Equals("DELETED")) //if goal is deleted, dont display it
                {
                    try
                    {
                        Goal thisGoal = goalDatabase.GetGoal(selectedGoal.GoalId).Result;
                        selectedGoal.setGoal(thisGoal);//to update information of Goal object
                        SelectedGoals.Add(selectedGoal);
                    }
                    catch (Exception e)
                    {
                        //possibly NullReferenceException
                        Debug.WriteLine("###############  exception: " + e.Message);
                    }
                }
            }
        }
示例#2
0
        public async Task <List <SelectedGoal> > getSelectedGoalsToday()
        {
            var selectedGoalsToday = await selectedGoalDatabase.GetSelectedGoalsToday();

            return(selectedGoalsToday);
        }