コード例 #1
0
        /// <summary>
        /// delete a milestone given a valid milestone instance
        /// </summary>
        /// <param name="space"></param>
        /// <param name="user"></param>
        /// <param name="password"></param>
        /// <param name="milestone"></param>
        /// <returns></returns>
        public static bool DeleteMilestone(string user, string password, AssemblaMilestone milestone)
        {
            string space  = milestone.Space;
            string url    = GetMilestonesUrl(space) + "//" + milestone.Id;
            string result = string.Empty;

            return(qc.goget(url, user, password, string.Empty, SendDebug, out result));
        }
コード例 #2
0
        /// <summary>
        /// delete a milestone given a valid milestone instance
        /// </summary>
        /// <param name="space"></param>
        /// <param name="user"></param>
        /// <param name="password"></param>
        /// <param name="milestone"></param>
        /// <returns></returns>
        public static bool DeleteMilestone(string user, string password, AssemblaMilestone milestone)
        {
            string space = milestone.Space;
            string url = GetMilestonesUrl(space)+"//"+milestone.Id;
            string result = string.Empty;
            return qc.goget(url, user, password, string.Empty, SendDebug, out result);

        }
コード例 #3
0
ファイル: AssemblaMilestone.cs プロジェクト: larytet/JQuant
        /// <summary>
        /// delete a milestone given a valid milestone instance
        /// </summary>
        /// <param name="space"></param>
        /// <param name="user"></param>
        /// <param name="password"></param>
        /// <param name="milestone"></param>
        /// <returns></returns>
        public static bool DeleteMilestone(string user, string password, AssemblaMilestone milestone)
        {
            string         space = milestone.Space;
            string         url   = GetMilestonesUrl(space) + "//" + milestone.Id;
            HttpWebRequest hr    = WebRequest.Create(url) as HttpWebRequest;

            hr.Credentials     = new System.Net.NetworkCredential(user, password);
            hr.PreAuthenticate = true;
            hr.Method          = "GET";
            hr.ContentType     = "application/xml";
            HttpWebResponse wr = (HttpWebResponse)hr.GetResponse();

            return(wr.StatusCode == HttpStatusCode.OK);
        }
コード例 #4
0
        internal static List <AssemblaMilestone> getms(string space, string result)
        {
            XmlDocument xd = new XmlDocument();

            xd.LoadXml(result);
            List <AssemblaMilestone> docs = new List <AssemblaMilestone>();
            XmlNodeList xnl = xd.GetElementsByTagName("milestone");

            foreach (XmlNode xn in xnl)
            {
                AssemblaMilestone doc = new AssemblaMilestone();
                doc.Space = space;

                foreach (XmlNode dc in xn.ChildNodes)
                {
                    string m = dc.InnerText;
                    if (dc.Name == "id")
                    {
                        doc.Id = Convert.ToInt32(m);
                    }
                    else if (dc.Name == "space-id")
                    {
                        doc.SpaceId = m;
                    }
                    else if (dc.Name == "title")
                    {
                        doc.Name = m;
                    }
                    else if (dc.Name == "is-completed")
                    {
                        doc.isCompleted = Convert.ToBoolean(m);
                    }
                    else if (dc.Name == "description")
                    {
                        doc.Desc = m;
                    }
                }
                if (doc.isValid)
                {
                    docs.Add(doc);
                }
            }
            return(docs);
        }
コード例 #5
0
        internal static List<AssemblaMilestone> getms(string space,string result)
        {
            XmlDocument xd = new XmlDocument();
            xd.LoadXml(result);
            List<AssemblaMilestone> docs = new List<AssemblaMilestone>();
            XmlNodeList xnl = xd.GetElementsByTagName("milestone");
            foreach (XmlNode xn in xnl)
            {
                AssemblaMilestone doc = new AssemblaMilestone();
                doc.Space = space;

                foreach (XmlNode dc in xn.ChildNodes)
                {
                    string m = dc.InnerText;
                    if (dc.Name == "id")
                        doc.Id = Convert.ToInt32(m);
                    else if (dc.Name == "space-id")
                        doc.SpaceId = m;
                    else if (dc.Name == "title")
                        doc.Name = m;
                    else if (dc.Name == "is-completed")
                        doc.isCompleted = Convert.ToBoolean(m);
                    else if (dc.Name == "description")
                        doc.Desc = m;
                }
                if (doc.isValid)
                    docs.Add(doc);
            }
            return docs;
        }
コード例 #6
0
 /// <summary>
 /// delete a milestone given a valid milestone instance
 /// </summary>
 /// <param name="space"></param>
 /// <param name="user"></param>
 /// <param name="password"></param>
 /// <param name="milestone"></param>
 /// <returns></returns>
 public static bool DeleteMilestone(string user, string password, AssemblaMilestone milestone)
 {
     string space = milestone.Space;
     string url = GetMilestonesUrl(space)+"//"+milestone.Id;
     HttpWebRequest hr = WebRequest.Create(url) as HttpWebRequest;
     hr.Credentials = new System.Net.NetworkCredential(user, password);
     hr.PreAuthenticate = true;
     hr.Method = "GET";
     hr.ContentType = "application/xml";
     HttpWebResponse wr = (HttpWebResponse)hr.GetResponse();
     return wr.StatusCode == HttpStatusCode.OK;
 }