GetSelectOptions() 개인적인 메소드

Gets the collection of possible values from the select with specified Id
private GetSelectOptions ( string selectId ) : string>.Dictionary
selectId string ID of the select element in the page
리턴 string>.Dictionary
예제 #1
0
        /// <summary>
        /// Gets the list of all versions project issue can target
        /// </summary>
        /// <param name="projectId">Project Id</param>
        /// <returns>List of all the versions available for the user in selected project</returns>
        public List <Version> GetVersions(int projectId)
        {
            XhtmlPage      page     = new XhtmlPage(this.httpHelper.GetWebRequest(this.ConstructUri(String.Format(NewIssueRelativeUri, projectId))));
            List <Version> versions = new List <Version>();

            foreach (KeyValuePair <int, string> kv in page.GetSelectOptions("issue_fixed_version_id"))
            {
                versions.Add(new Version()
                {
                    Id = kv.Key, Name = kv.Value
                });
            }

            return(versions);
        }
예제 #2
0
        /// <summary>
        /// Gets the list of all users available to be assigned to project issue
        /// </summary>
        /// <param name="projectId">Project Id</param>
        /// <returns>List of all the users available to be assigned to project issues</returns>
        public List <User> GetAssignees(int projectId)
        {
            XhtmlPage   page  = new XhtmlPage(this.httpHelper.GetWebRequest(this.ConstructUri(String.Format(NewIssueRelativeUri, projectId))));
            List <User> users = new List <User>();

            foreach (KeyValuePair <int, string> kv in page.GetSelectOptions("issue_assigned_to_id"))
            {
                users.Add(new User()
                {
                    Id = kv.Key, Name = kv.Value
                });
            }

            return(users);
        }
예제 #3
0
        /// <summary>
        /// Gets the list of all available project issue statuses
        /// </summary>
        /// <param name="projectId">Project Id</param>
        /// <returns>List of all the issue statuses available for the user in selected project</returns>
        public List <Status> GetStatuses(int projectId)
        {
            XhtmlPage     page     = new XhtmlPage(this.httpHelper.GetWebRequest(this.ConstructUri(String.Format(NewIssueRelativeUri, projectId))));
            List <Status> statuses = new List <Status>();

            foreach (KeyValuePair <int, string> kv in page.GetSelectOptions("issue_status_id"))
            {
                statuses.Add(new Status()
                {
                    Id = kv.Key, Name = kv.Value
                });
            }

            return(statuses);
        }
예제 #4
0
        /// <summary>
        /// Gets the list of all available project issue priorities
        /// </summary>
        /// <param name="projectId">Project Id</param>
        /// <returns>List of all the issue priorities available for the user in selected project</returns>
        public List <Priority> GetPriorities(int projectId)
        {
            XhtmlPage       page       = new XhtmlPage(this.httpHelper.GetWebRequest(this.ConstructUri(String.Format(NewIssueRelativeUri, projectId))));
            List <Priority> priorities = new List <Priority>();

            foreach (KeyValuePair <int, string> kv in page.GetSelectOptions("issue_priority_id"))
            {
                priorities.Add(new Priority()
                {
                    Id = kv.Key, Name = kv.Value
                });
            }

            return(priorities);
        }
예제 #5
0
        /// <summary>
        /// Gets the list of all available project activities
        /// </summary>
        /// <param name="projectId">Project Id</param>
        /// <returns>List of all the activities available for the user</returns>
        public List <Activity> GetActivities(int projectId)
        {
            if (_cache.GetActivities(projectId) != null)
            {
                return(_cache.GetActivities(projectId));
            }
            XhtmlPage page = new XhtmlPage(this.httpHelper.GetWebRequest(this.ConstructUri(String.Format(TimeLogFormRelativeUri, projectId))));

            List <Activity> activities = new List <Activity>();

            foreach (KeyValuePair <int, string> kv in page.GetSelectOptions("time_entry_activity_id"))
            {
                activities.Add(new Activity()
                {
                    Id = kv.Key, Description = kv.Value
                });
            }

            _cache.SetActivities(projectId, activities);
            return(activities);
        }
예제 #6
0
        /// <summary>
        /// Gets the list of all versions project issue can target
        /// </summary>
        /// <param name="projectId">Project Id</param>
        /// <returns>List of all the versions available for the user in selected project</returns>
        public List<Version> GetVersions(int projectId)
        {
            XhtmlPage page = new XhtmlPage(this.httpHelper.GetWebRequest(this.ConstructUri(String.Format(NewIssueRelativeUri, projectId))));
            List<Version> versions = new List<Version>();
            foreach (KeyValuePair<int, string> kv in page.GetSelectOptions("issue_fixed_version_id"))
            {
                versions.Add(new Version() { Id = kv.Key, Name = kv.Value });
            }

            return versions;
        }
예제 #7
0
        /// <summary>
        /// Gets the list of all available project trackers
        /// </summary>
        /// <param name="projectId">Project Id</param>
        /// <returns>List of all the trackers available for the user in selected project</returns>
        public List<Tracker> GetTrackers(int projectId)
        {
            XhtmlPage page = new XhtmlPage(this.httpHelper.GetWebRequest(this.ConstructUri(String.Format(NewIssueRelativeUri, projectId))));
            List<Tracker> trackers = new List<Tracker>();
            foreach (KeyValuePair<int, string> kv in page.GetSelectOptions("issue_tracker_id"))
            {
                trackers.Add(new Tracker() { Id = kv.Key, Name = kv.Value });
            }

            return trackers;
        }
예제 #8
0
        /// <summary>
        /// Gets the list of all available project issue statuses
        /// </summary>
        /// <param name="projectId">Project Id</param>
        /// <returns>List of all the issue statuses available for the user in selected project</returns>
        public List<Status> GetStatuses(int projectId)
        {
            XhtmlPage page = new XhtmlPage(this.httpHelper.GetWebRequest(this.ConstructUri(String.Format(NewIssueRelativeUri, projectId))));
            List<Status> statuses = new List<Status>();
            foreach (KeyValuePair<int, string> kv in page.GetSelectOptions("issue_status_id"))
            {
                statuses.Add(new Status() { Id = kv.Key, Name = kv.Value });
            }

            return statuses;
        }
예제 #9
0
        /// <summary>
        /// Gets the list of all available project activities
        /// </summary>
        /// <param name="projectId">Project Id</param>
        /// <returns>List of all the activities available for the user</returns>
        public List<Activity> GetActivities(int projectId)
        {
            if (_cache.GetActivities(projectId) != null)
            {
                return _cache.GetActivities(projectId);
            }
            XhtmlPage page = new XhtmlPage(this.httpHelper.GetWebRequest(this.ConstructUri(String.Format(TimeLogFormRelativeUri, projectId))));

            List<Activity> activities = new List<Activity>();
            foreach (KeyValuePair<int, string> kv in page.GetSelectOptions("time_entry_activity_id"))
            {
                activities.Add(new Activity() { Id = kv.Key, Description = kv.Value });
            }

            _cache.SetActivities(projectId, activities);
            return activities;
        }