//creates header for Pollutant filter and adds to dictionary protected static void addPollutant(Dictionary <string, string> header, PollutantFilter filter) { if (filter != null) { string key = Resources.GetGlobal("Common", "Pollutant"); string value = string.Empty; PollutantFilter.Level level = filter.SearchLevel(); if (level == PollutantFilter.Level.All) { value = Resources.GetGlobal("Common", "AllPollutants"); } else if (level == PollutantFilter.Level.PollutantGroup) { value = LOVResources.PollutantGroupName(ListOfValues.GetPollutant(filter.PollutantGroupID).Code); } else { value = LOVResources.PollutantName(ListOfValues.GetPollutant(filter.PollutantID).Code); } header.Add(key, value); } }
/// <summary> /// GetPollutantFilter /// </summary> public static PollutantFilter GetPollutantFilter(string code, int level) { PollutantFilter filter = new PollutantFilter(); LOV_POLLUTANT pollutant = ListOfValues.GetPollutant(code); if (level == 1) { if (pollutant.ParentID != null) { filter.PollutantID = pollutant.LOV_PollutantID; filter.PollutantGroupID = pollutant.ParentID.Value; } else { // confidential in group, same id filter.PollutantID = pollutant.LOV_PollutantID; filter.PollutantGroupID = pollutant.LOV_PollutantID; } } else if (level == 0) { filter.PollutantID = PollutantFilter.AllPollutantsInGroupID; filter.PollutantGroupID = pollutant.LOV_PollutantID; } return(filter); }
public PollutantFilter PopulateFilter() { PollutantFilter filter = new PollutantFilter(); filter.PollutantGroupID = Convert.ToInt32(this.cbPollutantGroup.SelectedValue); filter.PollutantID = Convert.ToInt32(this.cbPollutant.SelectedValue); return(filter); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Filter = LinkSearchBuilder.GetPollutantFilter(Request); populatePollutantGroups(); } }
public static PollutantFilter GetPollutantFilter(HttpRequest request) { if (HasPollutantFilter(request)) { PollutantFilter filter = new PollutantFilter(); filter.PollutantGroupID = toInt(request.QueryString[POLLUTANTGROUP]); filter.PollutantID = toInt(request.QueryString[POLLUTANT]); return(filter); } return(null); }
// -------------------------------------------------------------------------------------------------------------------- // Pollutant filter // -------------------------------------------------------------------------------------------------------------------- #region PollutantFilter private static string SerializeToUrl(PollutantFilter filter) { string result = String.Empty; if (filter != null) { result += addParameter(POLLUTANTGROUP, filter.PollutantGroupID); result += addParameter(POLLUTANT, filter.PollutantID); } return(result); }
public void PopulateFilters(out PollutantFilter pollutantFilter, out MediumFilter mediumFilter) { if (!isCollapsed()) { pollutantFilter = this.ucPollutantSearchOptionEPER.PopulateFilter(); mediumFilter = this.ucMediumSearchOptionEPER.PopulateFilter(); } else { pollutantFilter = null; mediumFilter = null; } }