private IEnumerable <Project> OnLoadProjects() { var response = ProjectApi.List(Connection, Id); return(response.Data.Select(p => new Project { Id = p.Id, Name = p.Name, Connection = Connection })); }
private void LoadDetails() { var response = ProjectApi.Show(Connection, Id); if (response.Data != null) { _description = response.Data.Description ?? string.Empty; _projectType = new ProjectType { Code = response.Data.ProjectType.Code, DisplayName = response.Data.ProjectType.Name }; _stringCount = response.Data.StringCount; _wordCount = response.Data.WordCount; } }
private Project OnCreateProject(Project newProject) { var response = ProjectApi.Create(Connection, Id, newProject.Name, newProject.Description, newProject.Type.Code); if (response.Meta.Status == 201 && response.Data != null) { newProject.Id = response.Data.Id; newProject.Connection = Connection; } else { newProject = null; } return(newProject); }
private bool OnDeleteProject(Project project) { return(ProjectApi.Delete(Connection, project.Id)); }