protected void ButtonProject_Click(object sender, EventArgs e) { string authToken = HttpContext.Current.Session["authToken"] as string; List <Project> proj_list = Glue.ProjectList(authToken); // Show the request and response in the form. // This is for learning purpose. IRestResponse response = Glue.m_lastResponse; TextBoxRequest.Text = response.ResponseUri.AbsoluteUri; TextBoxResponse.Text = response.Content; // We want to get hold of one project. // For simplicity, just pick up arbitrary one. int proj_index = Convert.ToInt32(HttpContext.Current.Session["projectIndex"]); proj_index %= proj_list.Count; Project proj = proj_list[proj_index++]; string project_id = proj.project_id; string project_name = proj.project_name; Session["projectIndex"] = proj_index; Session["projectId"] = project_id; TextBoxProjectName.Text = project_name + " (" + proj_index.ToString() + "/" + proj_list.Count.ToString() + ")"; // No model in a viewer, yet. iframeGlue.Src = ""; }
//============================================================ // Projects //============================================================ protected void ButtonProject_Click(object sender, EventArgs e) { string authToken = Session["authToken"] as string; List <Project> proj_list = Glue.ProjectList(authToken); ShowRequestResponse(); if (proj_list == null) { return; } // Set up a project list proj_list = proj_list.OrderBy(x => x.project_name).ToList(); DropDownListProjects.DataSource = proj_list; DropDownListProjects.DataTextField = "project_name"; DropDownListProjects.DataValueField = "project_id"; DropDownListProjects.DataBind(); DropDownListProjects.SelectedIndex = 0; }