private string GetTaskStatusUriString(ProjectTaskStatus status) { string result = ""; switch (status) { case ProjectTaskStatus.NotAccept: result = "notaccept"; break; case ProjectTaskStatus.Open: result = "open"; break; case ProjectTaskStatus.Closed: result = "closed"; break; case ProjectTaskStatus.Disable: result = "disable"; break; case ProjectTaskStatus.Unclassified: result = "unclassified"; break; case ProjectTaskStatus.NotInMilestone: result = "notinmilestone"; break; } return result; }
/// <summary> /// Returns the list with the detailed information about the tasks for the current user /// within specified project /// </summary> /// <param name="id">Project ID</param> /// <param name="status">Task status</param> /// <returns>Tasks collection</returns> public ProjectTaskCollection GetTasksMyByProject(int id, ProjectTaskStatus status = ProjectTaskStatus.Open) { return GetRESTCollection<ProjectTaskCollection>("api/1.0/project/{0}/task/@self/{1}", id, GetTaskStatusUriString(status)); }
/// <summary> /// Returns the list with the detailed information about the tasks for the current user /// within specified project /// </summary> /// <param name="project">Project</param> /// <param name="status">Task status</param> /// <returns>Tasks collection</returns> public ProjectTaskCollection GetTasksMyByProject(ProjectBrief project, ProjectTaskStatus status) { return GetTasksMyByProject(project.ID, status); }
/// <summary> /// Returns the list with the detailed information about the tasks for the current user /// </summary> /// <param name="status">Task status</param> /// <returns>Tasks collection</returns> public ProjectTaskCollection GetTasksMy(ProjectTaskStatus status) { return GetRESTCollection<ProjectTaskCollection>("api/1.0/project/task/@self/{0}", GetTaskStatusUriString(status)); }
/// <summary> /// Returns the list of all tasks with the selected status in the project with the /// ID specified in the request /// </summary> /// <param name="projectID">Project ID</param> /// <param name="status">Task status</param> /// <returns>Tasks collection</returns> public ProjectTaskCollection GetTasksByProject(int projectID, ProjectTaskStatus status) { return GetRESTCollection<ProjectTaskCollection>("api/1.0/project/{0}/task/{1}", projectID, GetTaskStatusUriString(status)); }
/// <summary> /// Returns tasks with the project which have specified status /// </summary> /// <param name="status">Task status</param> /// <returns>Collection of tasks</returns> public ProjectTaskCollection GetTasks(ProjectTaskStatus status) { if (Connection == null) throw new Exception("GetTasks(): Connection property can not be null!"); return Connection.GetTasksByProject(this, status); }