private void DrawProfilesModule() { //Profiles.Search.Utilities.DataIO dropdowns = new Profiles.Search.Utilities.DataIO(); if (Convert.ToBoolean(ConfigurationSettings.AppSettings["ShowInstitutions"]) == true) { litInstitution.Text = SearchDropDowns.BuildDropdown("institution", "150", ""); } else { trInstitution.Visible = false; } }
public SearchPerson(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces) { txtSearchFor.Attributes.Add("onkeypress", "JavaScript:runScript(event);"); // txtFname.Attributes.Add("onkeypress", "JavaScript:runScript(event);"); // txtLname.Attributes.Add("onkeypress", "JavaScript:runScript(event);"); if (Request.QueryString["action"] == "modify") { this.ModifySearch(); } else { //Profiles.Search.Utilities.DataIO dropdowns = new Profiles.Search.Utilities.DataIO(); if (Convert.ToBoolean(ConfigurationSettings.AppSettings["ShowInstitutions"]) == true) { litInstitution.Text = SearchDropDowns.BuildDropdown("institution", "700", ""); } else { trInstitution.Visible = false; } /* * if (Convert.ToBoolean(ConfigurationSettings.AppSettings["ShowDepartments"]) == true) * { * litDepartment.Text = SearchDropDowns.BuildDropdown("department", "249", ""); * } * else * { * trDepartment.Visible = false; * } * * if (Convert.ToBoolean(ConfigurationSettings.AppSettings["ShowDivisions"]) == true) * { * litDivision.Text = SearchDropDowns.BuildDropdown("division", "249", ""); * } * else * { * trDivision.Visible = false; * } * if (Convert.ToBoolean(ConfigurationSettings.AppSettings["ShowOtherOptions"]) == false) * { * trOtherOptions.Visible = false; * } */ } BuildFacultyType(); BuildFilters(); }
private void ModifySearch() { Search.Utilities.DataIO data = new Profiles.Search.Utilities.DataIO(); bool institutiondropdown = false; bool departmentdropdown = false; bool divisiondropdown = false; string searchrequest = string.Empty; if (base.MasterPage != null) { if (base.MasterPage.SearchRequest.IsNullOrEmpty() == false) { searchrequest = base.MasterPage.SearchRequest; } } else if (Request.QueryString["searchrequest"].IsNullOrEmpty() == false) { searchrequest = Request.QueryString["searchrequest"]; } SearchRequest = new XmlDocument(); ctcFirst.SearchRequest = new XmlDocument(); SearchRequest.LoadXml(data.DecryptRequest(searchrequest)); ctcFirst.SearchRequest = this.SearchRequest; if (SearchRequest.SelectSingleNode("SearchOptions/MatchOptions/SearchString") != null) { txtSearchFor.Text = SearchRequest.SelectSingleNode("SearchOptions/MatchOptions/SearchString").InnerText; } if (SearchRequest.SelectSingleNode("SearchOptions/MatchOptions/SearchString/@ExactMatch") != null) { switch (SearchRequest.SelectSingleNode("SearchOptions/MatchOptions/SearchString/@ExactMatch").Value) { case "true": chkExactphrase.Checked = true; break; case "false": chkExactphrase.Checked = false; break; } } if (SearchRequest.SelectSingleNode("SearchOptions/MatchOptions/SearchFiltersList") != null) { foreach (XmlNode x in SearchRequest.SelectNodes("SearchOptions/MatchOptions/SearchFiltersList/SearchFilter")) { if (x.SelectSingleNode("@Property").Value == "http://vivoweb.org/ontology/core#personInPosition" && x.SelectSingleNode("@Property2").Value == "http://vivoweb.org/ontology/core#positionInOrganization") { litInstitution.Text = SearchDropDowns.BuildDropdown("institution", "249", x.InnerText); institutiondropdown = true; if (x.SelectSingleNode("@IsExclude").Value == "1") { institutionallexcept.Checked = true; } else { institutionallexcept.Checked = false; } } if (x.SelectSingleNode("@Property").Value == "http://vivoweb.org/ontology/core#personInPosition" && x.SelectSingleNode("@Property2").Value == "http://profiles.catalyst.harvard.edu/ontology/prns#positionInDepartment") { litDepartment.Text = SearchDropDowns.BuildDropdown("department", "249", x.InnerText); departmentdropdown = true; if (x.SelectSingleNode("@IsExclude").Value == "1") { departmentallexcept.Checked = true; } else { departmentallexcept.Checked = false; } } if (x.SelectSingleNode("@Property").Value == "http://vivoweb.org/ontology/core#personInPosition" && x.SelectSingleNode("@Property2").Value == "http://profiles.catalyst.harvard.edu/ontology/prns#positionInDivision") { litDivision.Text = SearchDropDowns.BuildDropdown("division", "249", x.InnerText); divisiondropdown = true; if (x.SelectSingleNode("@IsExclude").Value == "1") { divisionallexcept.Checked = true; } else { divisionallexcept.Checked = false; } } if (x.SelectSingleNode("@Property").Value == "http://profiles.catalyst.harvard.edu/ontology/prns#hasPersonFilter") { } if (x.SelectSingleNode("@Property").Value == "http://xmlns.com/foaf/0.1/firstName") { txtFname.Text = x.InnerText; } if (x.SelectSingleNode("@Property").Value == "http://xmlns.com/foaf/0.1/lastName") { txtLname.Text = x.InnerText; } } } if (!institutiondropdown) { litInstitution.Text = SearchDropDowns.BuildDropdown("institution", "249", ""); } if (!departmentdropdown) { litDepartment.Text = SearchDropDowns.BuildDropdown("department", "249", ""); } if (!divisiondropdown) { litDivision.Text = SearchDropDowns.BuildDropdown("division", "249", ""); } }