private void BindGrid()
        {
            string sortField     = Grid1.SortField;
            string sortDirection = Grid1.SortDirection;
            Opers  o             = new Opers();
            string ret           = o.getRest(Session["url"].ToString(), "/qcbin/rest/domains/" + Session["Domain"] + "/projects/" + Session["Project"] + "/defects");

            XmlDocument xmldoc = new XmlDocument();

            xmldoc.LoadXml(ret);
            XmlNodeList nodelist = xmldoc.SelectSingleNode("Entities").ChildNodes;

            // o.ConvertXMLToDataSet(ret);
            DataTable  table   = new DataTable();
            DataColumn column1 = new DataColumn("ID", typeof(string));
            DataColumn column2 = new DataColumn("Name", typeof(String));
            DataColumn column3 = new DataColumn("CreationTime", typeof(string));
            DataColumn column4 = new DataColumn("Priority", typeof(string));
            DataColumn column5 = new DataColumn("Status", typeof(string));
            DataColumn column6 = new DataColumn("Description", typeof(string));

            table.Columns.Add(column1);
            table.Columns.Add(column2);
            table.Columns.Add(column3);
            table.Columns.Add(column4);
            table.Columns.Add(column5);
            table.Columns.Add(column6);

            for (int i = 0; i < nodelist.Count; i++)
            {
                DataRow row = table.NewRow();
                row[0] = xmldoc.SelectNodes("//Field[@Name='id']")[i].InnerText;
                row[1] = xmldoc.SelectNodes("//Field[@Name='name']")[i].InnerText;
                row[2] = xmldoc.SelectNodes("//Field[@Name='creation-time']")[i].InnerText;
                row[3] = xmldoc.SelectNodes("//Field[@Name='priority']")[i].InnerText;
                row[4] = xmldoc.SelectNodes("//Field[@Name='status']")[i].InnerText;
                row[5] = xmldoc.SelectNodes("//Field[@Name='description']")[i].InnerText;
                table.Rows.Add(row);
            }

            DataView view1 = table.DefaultView;

            view1.Sort = String.Format("{0} {1}", sortField, sortDirection);
            DataSet ds = new DataSet();

            ds.Tables.Add(table);
            Grid1.DataSource = ds;
            Grid1.DataBind();
        }
        private void getSeverity()
        {
            Opers  o   = new Opers();
            string ret = o.getRest(Session["url"].ToString(), "/qcbin/rest/domains/" + Session["Domain"] + "/projects/" + Session["Project"] + "/customization/used-lists?name=Severity");

            XmlDocument xmldoc = new XmlDocument();

            xmldoc.LoadXml(ret);
            XmlNodeList nodelist = xmldoc.SelectSingleNode("//Items").ChildNodes;

            for (int i = 0; i < nodelist.Count; i++)
            {
                ddSeverity.Items.Add(nodelist[i].Attributes["value"].Value, nodelist[i].Attributes["value"].Value);
            }
        }
        private void LoadData()
        {
            getStatus();
            getPriority();
            string id  = Request.QueryString["id"];
            Opers  o   = new Opers();
            string ret = o.getRest(Session["url"].ToString(), "/qcbin/rest/domains/" + Session["Domain"] + "/projects/" + Session["Project"] + "/defects/" + id);

            XmlDocument xmldoc = new XmlDocument();

            xmldoc.LoadXml(ret);
            lblID.Text         = xmldoc.SelectSingleNode("//Field[@Name='id']").InnerText;
            lblName.Text       = xmldoc.SelectSingleNode("//Field[@Name='name']").InnerText;
            ddStatus.Text      = xmldoc.SelectSingleNode("//Field[@Name='status']").InnerText;
            ddPriority.Text    = xmldoc.SelectSingleNode("//Field[@Name='priority']").InnerText;
            dCreationTime.Text = xmldoc.SelectSingleNode("//Field[@Name='creation-time']").InnerText;
            hDescription.Text  = xmldoc.SelectSingleNode("//Field[@Name='description']").InnerText;
        }