Ejemplo n.º 1
0
        private void AddFilters(string filterQueryParam, int startIndex)
        {
            List <char> separators  = SeparatorsFromFilterQueryParam(filterQueryParam);
            char        placeFiller = '»';

            separators.Insert(0, placeFiller);
            string[] filters = filterQueryParam.Substring(startIndex).Split(new char[] { ',', ';' });
            for (int i = 0; i < filters.Count(); i++)
            {
                FilterItem fItem = GetFilterItem(filters[i], separators[i]);
                if (fItem != null)
                {
                    Filter.Add(fItem);
                }
            }
        }
 private void AddFilter(SizeKeyType size)
 {
     ComboBox sizeRefBox = size == SizeKeyType.Dimension ? comboBoxDimensions : comboBoxMetrics;
     if (sizeRefBox.SelectedItem != null)
     {
         KeyValuePair<string, string> item = (sizeRefBox.SelectedItem as Nullable<KeyValuePair<string, string>>).Value;
         KeyValuePair<string, string> selectedOperator = (comboBoxOperator.SelectedItem as Nullable<KeyValuePair<string, string>>).Value;
         FilterItem fItem = new FilterItem(item.Key, item.Value,
                  new SizeOperator(selectedOperator.Key, selectedOperator.Value), textBoxExpression.Text,
                  (SizeKeyType)size, _query.Filter.Count == 0 ?
                  LogicalOperator.None : LogicalOperator.And);
         _query.Filter.Add(fItem);
         BindFilterListBox();
     }
 }