public async void Edit() { Project p = new Project() { Project_Name = Project_NameVM, Project_Description = Project_DescriptionVM, Project_Deadline = TimeConverter.ConverterToDateTime(Project_DeadlineDateVM, Project_DeadlineTimeVM), UserIds = new List <int>() }; p.UserIds.Add(LeSingleton.LoggedUser.User_Id); foreach (ScrumUser selectedUser in selectedUsers) { p.UserIds.Add(selectedUser.User_Id); } bool success = await ProjectsPer.Edit(p, LeSingleton.SelectedProject.Project_Id); if (success) { foreach (Project project in Projects) { if (project.Project_Id == LeSingleton.SelectedProject.Project_Id) { project.Project_Name = Project_NameVM; project.Project_Description = Project_DescriptionVM; project.Project_Deadline = TimeConverter.ConverterToDateTime(Project_DeadlineDateVM, Project_DeadlineTimeVM); break; } } } Reset(); }
public async void LoadProjects() { List <Project> leProjects = await ProjectsPer.GetProjects(LeSingleton.LoggedUser.User_Id); if (leProjects != null) { foreach (Project leProject in leProjects) { Projects.Add(leProject); } } }
public async void DeletePro() { bool success = await ProjectsPer.Delete(LeSingleton.SelectedProject.Project_Id); if (success) { Project p = null; foreach (Project project in Projects) { if (project.Project_Id == LeSingleton.SelectedProject.Project_Id) { p = project; } } Projects.Remove(p); } Reset(); }
public async void CreateProject() { Project p = new Project() { Project_Name = Project_NameVM, Project_Description = Project_DescriptionVM, Project_Deadline = TimeConverter.ConverterToDateTime(Project_DeadlineDateVM, Project_DeadlineTimeVM), UserIds = new List <int>() }; p.UserIds.Add(LeSingleton.LoggedUser.User_Id); foreach (ScrumUser selectedUser in selectedUsers) { p.UserIds.Add(selectedUser.User_Id); } Project projectToAdd = await ProjectsPer.Create(p); if (projectToAdd != null) { Projects.Add(projectToAdd); } Reset(); }