Example #1
0
        //Nieuwe sprint aan database toevoegen
        private async void newSprintClicked(object sender, EventArgs e)
        {
            ContactDataBase.createNewSprint(ContactDataBase.currentUserName, ContactDataBase.currentToken, sprintName.Text, Convert.ToInt32(sprintDuration.Text), Convert.ToInt32(tPoints.Text), startDate.Date, this.project.projectid);
            project.CurrentSprint = (Sprint)ContactDataBase.GetSprint(ContactDataBase.currentUserName, ContactDataBase.currentToken, project.projectid);
            project.Tasks         = (List <Task>)ContactDataBase.GetTasks(ContactDataBase.currentUserName, ContactDataBase.currentToken, project.projectid);

            //Push de nieuwe pagina op de stack
            var page1 = new ProjectInfoPage(project);
            var page2 = new SprintPage(project.CurrentSprint, project.Tasks, project);
            var page3 = new NewSprintPage(project);
            var page4 = new burndown(project);
            await Navigation.PushAsync(new TabbedPage()
            {
                Children = { page1, page2, page3, page4 }, Title = project.projectname, BackgroundColor = GeneralSettings.backgroundColor, CurrentPage = page2
            });

            //Verweider de oude pagina's uit de stack

            Navigation.RemovePage(Navigation.NavigationStack[2]);
        }
        //Taak toevoegen aan de sprint
        private async void AddTaskClicked(object sender, EventArgs e)
        {
            Task s = (Task)table.SelectedItem;

            ContactDataBase.addTaskToSprint(ContactDataBase.currentUserName, ContactDataBase.currentToken, s.taskid, s.projectid, sprint.sprintid);
            f.CurrentSprint = (Sprint)ContactDataBase.GetSprint(ContactDataBase.currentUserName, ContactDataBase.currentToken, f.projectid);
            f.Tasks         = (List <Task>)ContactDataBase.GetTasks(ContactDataBase.currentUserName, ContactDataBase.currentToken, f.projectid);

            List <Task> tasks2 = new List <Task>();

            foreach (Task t in f.Tasks)
            {
                if (s != null && t.sprintid == f.CurrentSprint.sprintid)
                {
                    tasks2.Add(t);
                }
            }
            if (s != null)
            {
                f.CurrentSprint.Sprinttasks = tasks2;
            }
            var page1 = new ProjectInfoPage(f);
            var page2 = new SprintPage(f.CurrentSprint, f.Tasks, f);
            var page3 = new NewSprintPage(f);
            var page4 = new burndown(f);
            //Push de nieuwe pagina op de stack
            await Navigation.PushAsync(new TabbedPage()
            {
                Children = { page1, page2, page3, page4 }, Title = f.projectname, BackgroundColor = GeneralSettings.backgroundColor, CurrentPage = page2
            });

            //Verweider de oude pagina's uit de stack
            for (int counter = 1; counter <= 2; counter++)
            {
                Navigation.RemovePage(Navigation.NavigationStack[2]);
            }
        }