public static string BuildDropdown(string type, string width, string defaultitem) { Utilities.DataIO data = new Profiles.Search.Utilities.DataIO(); string output = string.Empty; List<GenericListItem> list = new List<GenericListItem>(); switch (type) { case "institution": list = data.GetInstitutions(); break; case "department": list = data.GetDepartments(); break; case "division": list = data.GetDivisions(); break; } //if (defaultitem.IsNullOrEmpty()) output += "<option value=\"\"></option>"; foreach (GenericListItem item in list) { if (!defaultitem.IsNullOrEmpty() && defaultitem == item.Value) output += "<option selected=\"true\" value=\"" + item.Value + "\">" + item.Text + "</option>"; else output += "<option value=\"" + item.Value + "\">" + item.Text + "</option>"; } return "<select title=\"" + type + "\" name=\"" + type + "\" id=\"" + type + "\" style=\"width:" + width + "px\">" + output + "</select>"; }
public static string BuildDropdown(string type,string width) { Utilities.DataIO data = new Profiles.Search.Utilities.DataIO(); string output = string.Empty; List<GenericListItem> list = new List<GenericListItem>(); switch (type) { case "institution": list = data.GetInstitutions(); break; case "department": list = data.GetDepartments(); break; case "division": list = data.GetDivisions(); break; } output += "<option value=\"\"> -- Select One -- </option>"; foreach (GenericListItem item in list) { output += "<option value=\"" + item.Value + "\">" + item.Text + "</option>"; } return "<select id=\"" + type + "\" style=\"width:" + width + "\">" + output + "</select>"; }
public static string BuildDropdown(string type, string width, string defaultitem) { Utilities.DataIO data = new Profiles.Search.Utilities.DataIO(); string output = string.Empty; List <GenericListItem> list = new List <GenericListItem>(); switch (type) { case "institution": list = data.GetInstitutions(); break; case "department": list = data.GetDepartments(); break; case "division": list = data.GetDivisions(); break; } //if (defaultitem.IsNullOrEmpty()) output += "<option value=\"\"></option>"; foreach (GenericListItem item in list) { if (!defaultitem.IsNullOrEmpty() && defaultitem == item.Value) { output += "<option selected=\"true\" value=\"" + item.Value + "\">" + item.Text + "</option>"; } else { output += "<option value=\"" + item.Value + "\">" + item.Text + "</option>"; } } return("<select title=\"" + type + "\" name=\"" + type + "\" id=\"" + type + "\" style=\"width:" + width + "px\">" + output + "</select>"); }
private void DrawProfilesModule() { string output = string.Empty; string tab = string.Empty; tab = Request.QueryString["tab"]; if (Request.QueryString["searchtype"] == "everything") { tab = "all"; } if (Request.QueryString["searchtype"] == "people") { tab = "people"; } Utilities.DataIO data = new Profiles.Search.Utilities.DataIO(); if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchString", base.Namespaces) != null) { // output += "<li>" + base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchString", base.Namespaces).InnerText + "</li>"; foreach (XmlNode n in base.BaseData.SelectNodes("rdf:RDF/rdf:Description/vivo:overview/SearchDetails/SearchPhraseList/SearchPhrase", base.Namespaces)) { output += "<li>" + n.InnerText + "</li>"; } } if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property='http://xmlns.com/foaf/0.1/lastName']", base.Namespaces) != null) { output += "<li>" + base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property='http://xmlns.com/foaf/0.1/lastName']", base.Namespaces).InnerText + "</li>"; } if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property='http://xmlns.com/foaf/0.1/firstName']", base.Namespaces) != null) { output += "<li>" + base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property='http://xmlns.com/foaf/0.1/firstName']", base.Namespaces).InnerText + "</li>"; } if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property='http://profiles.catalyst.harvard.edu/ontology/prns#hasPersonFilter']", base.Namespaces) != null) { string s = string.Empty; if (!Request.QueryString["otherfilters"].IsNullOrEmpty()) { s = Request.QueryString["otherfilters"]; if (!s.IsNullOrEmpty()) { foreach (GenericListItem gi in data.GetOtherOptions(s)) { Filters = data.GetConvertedURIListItem(data.GetListOfFilters(), gi.Value); output += "<li>" + Filters + "</li>"; } } } else { List <GenericListItem> g = new List <GenericListItem>(); g = data.GetListOfFilters(); foreach (XmlNode x in base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property='http://profiles.catalyst.harvard.edu/ontology/prns#hasPersonFilter']", base.Namespaces)) { s = data.GetConvertedURIListItem(g, x.InnerText); output += "<li>" + s + "</li>"; } } } if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property2='http://vivoweb.org/ontology/core#positionInOrganization']", base.Namespaces) != null) { if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property2='http://vivoweb.org/ontology/core#positionInOrganization']/@IsExclude", base.Namespaces).Value == "1") { Institution = "(Except)"; } Institution += data.GetConvertedURIListItem(data.GetInstitutions(), base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property2='http://vivoweb.org/ontology/core#positionInOrganization']", base.Namespaces).InnerText); output += "<li>" + Institution + "</li>"; } if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property2='http://profiles.catalyst.harvard.edu/ontology/prns#positionInDepartment']", base.Namespaces) != null) { if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property2='http://profiles.catalyst.harvard.edu/ontology/prns#positionInDepartment']/@IsExclude", base.Namespaces).Value == "1") { Department = "(Except) "; } Department += data.GetConvertedURIListItem(data.GetDepartments(), base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property2='http://profiles.catalyst.harvard.edu/ontology/prns#positionInDepartment']", base.Namespaces).InnerText); output += "<li>" + Department + "</li>"; } if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property2='http://profiles.catalyst.harvard.edu/ontology/prns#positionInDivision']", base.Namespaces) != null) { Division = data.GetConvertedURIListItem(data.GetDivisions(), base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property2='http://profiles.catalyst.harvard.edu/ontology/prns#positionInDivision']", base.Namespaces).InnerText); output += "<li>" + Division + "</li>"; } if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:overview/SearchOptions/MatchOptions/SearchFiltersList/SearchFilter[@Property='http://profiles.catalyst.harvard.edu/ontology/prns#hasFacultyRank']", base.Namespaces) != null) { foreach (GenericListItem gi in data.GetFacultyRanks()) { if (base.BaseData.SelectSingleNode(".").InnerXml.Contains(gi.Value) && !gi.Value.IsNullOrEmpty()) { Rank = gi.Text; output += "<li>" + Rank + "</li>"; } } } if (base.BaseData.SelectNodes("rdf:RDF/rdf:Description/vivo:overview/SearchDetails/SearchPhraseList", base.Namespaces).Count > 0 && tab == "people") { litWhyText.Text = "<div style='margin-top:5px;'>Click \"Why?\" to see why a" + (tab == "people" ? " person" : "n item") + " matched the search.</div>"; } else { litWhyText.Visible = false; } litSearchCriteria.Text = output; }
private void DrawProfilesModule() { Search.Utilities.DataIO data = new Profiles.Search.Utilities.DataIO(); SessionManagement sm = new SessionManagement(); string subject = sm.Session().SessionID.ToString(); if (sm.Session().UserID == 0) Response.Redirect(Root.Domain + "/search"); litBackLink.Text = "<b>Search Proxies</b>"; if (Request.QueryString["fname"] != null) { txtFirstName.Text = Request.QueryString["fname"]; this.Fname = Request.QueryString["fname"]; } if (Request.QueryString["lname"] != null) { txtLastName.Text = Request.QueryString["lname"]; this.Lname = Request.QueryString["lname"]; } drpInstitution.DataSource = data.GetInstitutions(); drpInstitution.DataTextField = "Text"; drpInstitution.DataValueField = "Value"; drpInstitution.DataBind(); drpInstitution.Items.Insert(0, new ListItem("--Select--")); if (Request.QueryString["institution"] != null) { drpInstitution.SelectedIndex = drpInstitution.Items.IndexOf(drpInstitution.Items.FindByText(Request.QueryString["institution"])); this.Institution = Request.QueryString["institution"]; } drpDepartment.DataSource = data.GetDepartments(); drpDepartment.DataTextField = "Text"; drpDepartment.DataValueField = "Value"; drpDepartment.DataBind(); drpDepartment.Items.Insert(0, new ListItem("--Select--")); if (Request.QueryString["department"] != null) { drpDepartment.SelectedIndex = drpDepartment.Items.IndexOf(drpDepartment.Items.FindByText(Request.QueryString["department"])); this.Department = Request.QueryString["department"]; } drpDivision.DataSource = data.GetDivisions(); drpDivision.DataTextField = "Text"; drpDivision.DataValueField = "Value"; drpDivision.DataBind(); drpDivision.Items.Insert(0, new ListItem("--Select--")); if (Request.QueryString["division"] != null) { drpDivision.SelectedIndex = drpDivision.Items.IndexOf(drpDivision.Items.FindByText(Request.QueryString["division"])); this.Division = Request.QueryString["division"]; } this.Subject = Convert.ToInt64(Request.QueryString["subject"]); if (Request.QueryString["offset"] != null && Request.QueryString["totalrows"] != null) { this.ExecuteSearch(); } }