public async void StartDelete() { SprintsInProj.Clear(); StoryInProj.Clear(); List <Sprint> s = await SprintsPer.LoadBacklog(LeSingleton.SelectedProject.Project_Id); if (s != null) { foreach (Sprint spr in s) { SprintsInProj.Add(spr); } } List <Story> stor = await StoryPer.LoadBacklog(LeSingleton.SelectedProject.Project_Id); if (stor != null) { foreach (Story storey in stor) { StoryInProj.Add(storey); } } }
public async void LoadStories() { List <Story> st = await StoryPer.LoadSprintBacklog(LeSingleton.SelectedSprint.Sprint_Id); if (st != null) { foreach (Story storey in st) { switch (storey.Story_State) { case "ToDo": TodoCollection.Add(storey); break; case "Doing": DoingCollection.Add(storey); break; case "Done": DoneCollection.Add(storey); break; case "DoneDone": DoneDoneCollection.Add(storey); break; } } } }
/// <summary> /// Anvender det valgte projekt i singletonnen til at hente alle stories der ligger tilknyttet til projektet ud og sætte det ind i OC der er binded op til viewet. /// </summary> public async void LoadStories() { List <Story> st = await StoryPer.LoadBacklog(LeSingleton.SelectedProject.Project_Id); if (st != null) { foreach (Story storey in st) { Stories.Add(storey); } } }
public async void ChangeState(string name) { string removeState = DragStory.Story_State; DragStory.Story_State = name; bool success = await StoryPer.ChangeState(DragStory.Story_Id, DragStory); if (success) { switch (DragStory.Story_State) { case "ToDo": TodoCollection.Add(DragStory); break; case "Doing": DoingCollection.Add(DragStory); break; case "Done": DoneCollection.Add(DragStory); break; case "DoneDone": DoneDoneCollection.Add(DragStory); break; } switch (removeState) { case "ToDo": TodoCollection.Remove(DragStory); break; case "Doing": DoingCollection.Remove(DragStory); break; case "Done": DoneCollection.Remove(DragStory); break; case "DoneDone": DoneDoneCollection.Remove(DragStory); break; } } else { DragStory.Story_State = removeState; } }
/// <summary> /// Generere et nyt Objec af typen story for at kunne sende det med til WEB API'en for at kunne generere et nyt object der bliver sendt tilbage fra api'en hvis det lykkes. /// </summary> public async void CreateStory() { Story s = new Story() { Project_Id = LeSingleton.SelectedProject.Project_Id, Category = Story_CategoryVM, Story_Asignee = AssigneeVM, Story_Name = Story_NameVM, Story_description = Story_descriptionVM, Story_Points = Story_PointsVM, Story_Priority = Story_PriorityVM, Story_State = "ToDo", Story_Referee = LeSingleton.LoggedUser }; Story storyToAdd = await StoryPer.Create(s); if (storyToAdd != null) { Stories.Add(storyToAdd); } StoryReset(); }
/// <summary> ///Sætter load udenfor ¨konstrunktoren for at kunne overskue det bedre /// </summary> public async void Load() { SprintButton = "Create"; Sprint_StartDate = DateTimeOffset.Now; Sprint_EndDate = DateTimeOffset.Now.AddDays(14); List <Story> st = await StoryPer.LoadBacklog(LeSingleton.SelectedProject.Project_Id); if (st != null) { foreach (Story storey in st) { Backlog.Add(storey); } } }
/// <summary> /// Beder persitencen om at slette storien ved hjælp af API'en, /// Hvis det lykkes så fjerner vi storien fra viewet /// </summary> public async void RemoveStory() { bool success = await StoryPer.Delete(SelectedStory.Story_Id); if (success) { Story s = null; foreach (Story story in Stories) { if (story.Story_Id == SelectedStory.Story_Id) { s = story; } } Stories.Remove(s); } StoryReset(); }
/// <summary> /// Når brugeren har redigeret og trykket på knappen sendes et nyt object med til API'en for at kunne redigere objektet, /// hvis API'en lykkes retunere den true og objectet bliver opdateret i viewet. /// </summary> public async void Edit() { Story s = new Story() { Category = Story_CategoryVM, Story_Name = Story_NameVM, Story_Asignee = AssigneeVM, Story_description = Story_descriptionVM, Story_Priority = Story_PriorityVM, Story_Points = Story_PointsVM }; bool success = await StoryPer.Edit(s, SelectedStory.Story_Id); if (success) { SelectedStory.Story_Points = Story_PointsVM; SelectedStory.Story_description = Story_descriptionVM; SelectedStory.Story_Priority = Story_PriorityVM; SelectedStory.Story_Name = Story_NameVM; SelectedStory.Category = Story_CategoryVM; SelectedStory.Story_Asignee = AssigneeVM; } StoryReset(); }
public async void Load() { List <Sprint> spr = await SprintsPer.LoadBacklog(LeSingleton.SelectedProject.Project_Id); if (spr != null) { foreach (Sprint sprint in spr) { Sprints.Add(sprint); } } List <Story> st = await StoryPer.LoadBacklog(LeSingleton.SelectedProject.Project_Id); if (st != null) { foreach (Story storey in st) { Stories.Add(storey); } } }
/// <summary> /// Starter med at opdaterer knappen til at udføre en anden funktion end normalt. /// Derefter udfylder vi inout felterne i Viewet så brugeren kan se hvad de er igang med at redigere. /// </summary> public async void StartEdit() { SprintReset(); SletState = "Visible"; SprintButton = "Edit"; CreateCommand = new RelayCommand(EditSprint); Sprint_StartDate = TimeConverter.ConvertToDate(SelectedSprint.Sprint_Start); Sprint_StartTime = TimeConverter.ConvertToTime(SelectedSprint.Sprint_Start); Sprint_EndDate = TimeConverter.ConvertToDate(SelectedSprint.Sprint_End); Sprint_EndTime = TimeConverter.ConvertToTime(SelectedSprint.Sprint_End); Sprint_GoalVM = SelectedSprint.Sprint_Goal; SelectedSprint.Story_Ids = new List <int>(); List <Story> storiesInSprintBacklog = await StoryPer.LoadSprintBacklog(SelectedSprint.Sprint_Id); if (storiesInSprintBacklog != null) { foreach (Story story in storiesInSprintBacklog) { foreach (Story storey in Backlog) { if (storey.Story_Id == story.Story_Id) { DragStory = storey; } } if (DragStory != null) { MoveStory("SprintBacklog"); } DragStory = null; } } }