Esempio n. 1
0
        protected async override void OnAppearing()
        {

            base.OnAppearing();
            var allDecisions = await service.GetAllDecisions();
            List<Decision> decisionsFiltered = new List<Decision>();
             foreach (Decision d in allDecisions){
                if(d)
            }
            decisionList.ItemsSource = allDecisions;
        }
        protected async override void OnAppearing()
        {
            base.OnAppearing();
            var allDecisions = await service.GetAllDecisions();

            //List<Decision> decisionsFiltered = new List<Decision>();
            // foreach (Decision d in allDecisions){
            //    if(d.userId == userId)
            //    {
            //        decisionsFiltered.Add(d);
            //    }
            //}
            decisionList.ItemsSource = allDecisions;
        }
Esempio n. 3
0
        async void navigateToDecisionPage(object sender, System.EventArgs e)
        {
            if (titleText.Text == "")
            {
                await DisplayAlert("Empty Name", "Please enter decision name", "OK");
            }
            else
            {
                List <Decision> allDecisions = await service.GetAllDecisions();

                int      id = allDecisions.Count + 1;
                Decision d  = new Decision(id, titleText.Text, 50, 50);
                await service.AddDecision(id, titleText.Text, 50, 50);

                titleText.Text = "";
                await Navigation.PushAsync(new DecisionPage(id));
            }
        }