protected void Page_Load(object sender, EventArgs e) { BIM360WebServiceAPI apiObj = new BIM360WebServiceAPI(Request); // If no logged on, just redirect to the home page if (!apiObj.userLoggedIn) { string redirURL = BIM360WebServiceAPI.GetBaseURL() + "/default.aspx"; Response.Redirect(redirURL); } // Get the Project ID from the URL.. if not valid, just display message string projectID = Request.Params["id"]; if (projectID == "") { this.page_header.InnerHtml = "<h1>Invalid Project ID</b>: [" + projectID + "]</h1>"; return; } project_info_response_v1 tProj = apiObj.getProjectInfo(projectID); if (tProj != null) { string tHead = "<h1>Project: " + HttpUtility.UrlDecode(tProj.project_name) + " [ID=" + projectID + "]</h1>"; this.page_header.InnerHtml = tHead; string tHead2 = "<b>Project Created: </b>" + tProj.created_date + " <b>Roster Count: </b>" + tProj.project_roster.Count(); tHead2 += " <a class=\"roster_link\" id=\"roster_link\" href=\"javascript:void();\" onClick=\"viewProjectRoster('" + projectID + "');\">(View Roster)</a>"; this.page_sub_header.InnerHtml = tHead2; } else { this.page_header.InnerHtml = "<h1>Project: [ID=" + projectID + "]</h1>"; } string tJS = ""; tJS += "<script>"; tJS += "loadProjectTree(\"" + projectID + "\");"; tJS += "</script>"; this.page_contents.InnerHtml = tJS; }
static public string ajax_GetProjectRoster() { string buildHTML = ""; HttpRequest aRequest = HttpContext.Current.Request; BIM360WebServiceAPI apiObj = new BIM360WebServiceAPI(aRequest); // If no logged on, just redirect to the home page if (!apiObj.userLoggedIn) { return("<b>Unauthorized: Please login to continue</b>"); } // Get the ID string projectID = aRequest.Params["id"]; // Get the model info... project_info_response_v1 tProj = apiObj.getProjectInfo(projectID); if ((tProj == null) || (tProj.project_roster == null)) { return("<b>Roster Not Found</b>"); } buildHTML += "<center>"; buildHTML += "<table width=500 style=\"border: 1px solid #CCCCCC;\">"; buildHTML += "<tr bgcolor=\"#CCCCCC\">"; buildHTML += "<td><b>Login Name</b></td>"; buildHTML += "<td><b>Date Added</b></td>"; buildHTML += "</tr>"; foreach (user_info_response_v1 tUser in tProj.project_roster) { buildHTML += addRow(tUser.login_name, tUser.created_date); } buildHTML += "</table>"; return(buildHTML); }