public void update_issues_status(Issues issues, string status_id) { WebClient client = newWebClient(); client.Encoding = System.Text.Encoding.UTF8; NameValueCollection param = new NameValueCollection(); param.Add("issue[status_id]", status_id); client.UploadValues(string.Format("{0}/issues/{1}.xml", domain,issues.id), "PUT", param); }
public IList<Issues> load_issues(NameValueCollection query_params) { IList<Issues> issues_list = new List<Issues>(); WebClient client = newWebClient(); client.QueryString.Add(query_params); Stream stream = client.OpenRead(string.Format("{0}/issues.xml", domain)); XmlDocument xml = new XmlDocument(); xml.Load(stream); XmlNodeList node_list = xml.SelectNodes("issues/issue"); foreach (XmlNode node in node_list) { Issues issues = new Issues(); issues.id = node.SelectSingleNode("id").InnerText; XmlNode project = node.SelectSingleNode("project"); issues.project = new Item { id = project.Attributes["id"].Value, name = project.Attributes["name"].Value }; XmlNode tracker = node.SelectSingleNode("tracker"); issues.tracker = new Item { id = tracker.Attributes["id"].Value, name = tracker.Attributes["name"].Value }; XmlNode status = node.SelectSingleNode("status"); issues.status = new Item { id = status.Attributes["id"].Value, name = status.Attributes["name"].Value }; XmlNode priority = node.SelectSingleNode("priority"); issues.priority = new Item { id = priority.Attributes["id"].Value, name = priority.Attributes["name"].Value }; XmlNode author = node.SelectSingleNode("author"); issues.author = new Item { id = author.Attributes["id"].Value, name = author.Attributes["name"].Value }; XmlNode assigned_to = node.SelectSingleNode("assigned_to"); if (assigned_to != null) issues.assigned_to = new Item { id = assigned_to.Attributes["id"].Value, name = assigned_to.Attributes["name"].Value }; issues.subject = node.SelectSingleNode("subject").InnerText; issues.description = node.SelectSingleNode("description").InnerText; issues.start_date = node.SelectSingleNode("start_date").InnerText; issues.due_date = node.SelectSingleNode("due_date").InnerText; issues.done_ratio = node.SelectSingleNode("done_ratio").InnerText; issues.estimated_hours = node.SelectSingleNode("estimated_hours").InnerText; issues.created_on = node.SelectSingleNode("created_on").InnerText; issues.updated_on = node.SelectSingleNode("updated_on").InnerText; issues_list.Add(issues); } return issues_list; }