internal static string GetDataValueRangeFilderString(DataValueFilter dataValueFilter) { string WhereClause = " WHERE NOT ("; string CurrentThreadDecimalChar = System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator; string InvariantCultureDecimalChar = new System.Globalization.CultureInfo("en-US").NumberFormat.NumberDecimalSeparator; switch (dataValueFilter.OpertorType) { case OpertorType.EqualTo: WhereClause += " VAL([" + Data.DataValue + "]) = " + dataValueFilter.FromDataValue.ToString().Replace(CurrentThreadDecimalChar, InvariantCultureDecimalChar); break; case OpertorType.Between: //Inclusive of min & max values as per ANSI SQL WhereClause += "(VAL([" + Data.DataValue + "]) >= " + dataValueFilter.FromDataValue.ToString().Replace(CurrentThreadDecimalChar, InvariantCultureDecimalChar) + " AND VAL([" + Data.DataValue + "]) <= " + dataValueFilter.ToDataValue.ToString().Replace(CurrentThreadDecimalChar, InvariantCultureDecimalChar) + ")"; break; case OpertorType.GreaterThan: WhereClause += "(VAL([" + Data.DataValue + "]) > " + dataValueFilter.FromDataValue.ToString().Replace(CurrentThreadDecimalChar, InvariantCultureDecimalChar) + ")"; break; case OpertorType.LessThan: WhereClause += "(VAL([" + Data.DataValue + "]) < " + dataValueFilter.ToDataValue.ToString().Replace(CurrentThreadDecimalChar, InvariantCultureDecimalChar) + ")"; break; } WhereClause += " )"; return WhereClause; }
/// <summary> /// Clears all dataview filters /// </summary> public void Reset() { this._MostRecentData = false; this._DeletedDataNIds = string.Empty; this._DeletedSourceNIds = string.Empty; this._DeletedUnitNIds = string.Empty; this._DeletedSubgroupNIds = string.Empty; this._DeletedDataGIds = string.Empty; this._DeletedSourceNames = string.Empty; this._DeletedUnitGIds = string.Empty; this._DeletedSubgroupGIds = string.Empty; this._ShowSourceByIUS = true; this._ShowSubgroupByIndicator = true; this._ShowUnitByIndicator = true; this._ShowRecommendedSourceByRank = true; this._DeletedRanks = string.Empty; this._MostRecentData = false; this._DataValueFilter = new DataValueFilter(); this._IndicatorDataValueFilters.Clear(); this._IndicatorDataValueFilters.ShowIUS = true; this._IndicatorDataValueFilters.IncludeArea = false; this._UltraWinGridAutoFilters.Clear(); }