Exemple #1
0
    private void LoadDefaultFromQuery()
    {
        if (!String.IsNullOrEmpty(MainContext.QueryString["Type"]))
        {
            SearchFilter.SearchFilterType type = (SearchFilter.SearchFilterType)Enum.Parse(typeof(SearchFilter.SearchFilterType), MainContext.QueryString["Type"], true);

            string fieldName = MainContext.QueryString["FieldName"];
            string value1    = MainContext.QueryString["Value1"];
            string value2    = MainContext.QueryString["Value2"];

            if (!String.IsNullOrEmpty(value2))
            {
                PopulateValueRangeFilter(
                    type,
                    fieldName,
                    value1,
                    value2);
            }
            else
            {
                PopulateValueFilter(
                    type,
                    fieldName,
                    value1);
            }
        }

        ShowSelectedInput(SearchFilterObj.FilterType);
        RestoreControls();
    }
    private void ShowSelectedInput(SearchFilter.SearchFilterType filterType)
    {
        switch (filterType)
        {
        case SearchFilter.SearchFilterType.Text:
            ShowTextFilterInput();
            break;

        case SearchFilter.SearchFilterType.Boolean:
            ShowBooleanFilterInput();
            break;

        case SearchFilter.SearchFilterType.ValueRange:
            ShowValueRangeFilterInput();
            break;

        case SearchFilter.SearchFilterType.Date:
            ShowDateRangeFilterInput();
            break;

        default:
            HideAllInput();

            RemoveSearchFilter();
            break;
        }
    }
 private void PopulateValueFilter(SearchFilter.SearchFilterType typeField,
                                  string value, string val1, EventArgs e)
 {
     _searchFilterObj = SearchFilter.GetFactory()
                        .WithFilterType(typeField)
                        .WithFieldName(value)
                        .WithValue1(val1)
                        .Create();
 }
Exemple #4
0
    private void PopulateValueFilter(SearchFilter.SearchFilterType typeField,
                                     string value, string val1, EventArgs e)
    {
        PopulateValueFilter(
            typeField,
            value,
            val1);

        // Propagate event to parent
        OnBubbleEvent(e);
    }
Exemple #5
0
    public SearchFilter GetSearchResult( SearchFilter.SearchFilterType typeField,
         string value, string val1, out string message )
    {
        SearchFilter searchFilterObj = SearchFilter.GetFactory()
          .WithFilterType( typeField )
          .WithFieldName( value )
          .WithValue1( val1 )
          .Create();

        message = DisplayTextSearchMessage( searchFilterObj.FieldName, searchFilterObj.Value1 );
        return searchFilterObj;
    }
Exemple #6
0
    private void PopulateValueRangeFilter(SearchFilter.SearchFilterType typeField,
                                          string value, string val1, string val2)
    {
        SearchFilterObj = SearchFilter.GetFactory()
                          .WithFilterType(typeField)
                          .WithFieldName(value)
                          .WithValue1(val1)
                          .WithValue2(val2)
                          .Create();

        DisplayValueRangeMessage(SearchFilterObj.FieldName, SearchFilterObj.Value1, SearchFilterObj.Value2);
    }
    private void PopulateValueRangeFilter(SearchFilter.SearchFilterType typeField,
                                          string value, string val1, string val2, EventArgs e)
    {
        SearchFilterObj = SearchFilter.GetFactory()
                          .WithFilterType(typeField)
                          .WithFieldName(value)
                          .WithValue1(val1)
                          .WithValue2(val2)
                          .Create();

        DisplayValueRangeMessage(SearchFilterObj.FieldName, SearchFilterObj.Value1, SearchFilterObj.Value2);

        // Propagate event to parent
        OnBubbleEvent(e);
    }
Exemple #8
0
    private void PopulateValueFilter(SearchFilter.SearchFilterType typeField,
                                     string value, string val1)
    {
        string message = String.Empty;

        if (typeField == SearchFilter.SearchFilterType.Text)
        {
            SearchFilterObj = uxSearchTextPanel.GetSearchResult(typeField, value, val1, out message);
        }
        else if (typeField == SearchFilter.SearchFilterType.Boolean)
        {
            SearchFilterObj = uxSearchBooleanPanel.GetSearchResult(typeField, value, val1, out message);
        }
        uxMessageLabel.Text = message;
    }
Exemple #9
0
    public void GetSearchFilterObj(EventArgs e)
    {
        SearchFilter.SearchFilterType filterType = ParseSearchType(FieldTypes[uxFilterDrop.SelectedValue]);
        if (filterType == SearchFilter.SearchFilterType.Text)
        {
            PopulateValueFilter(
                SearchFilter.SearchFilterType.Text,
                uxFilterDrop.SelectedValue,
                uxSearchTextPanel.GetTextSearchValue(),
                e);
        }

        if (filterType == SearchFilter.SearchFilterType.Boolean)
        {
            PopulateValueFilter(
                SearchFilter.SearchFilterType.Boolean,
                uxFilterDrop.SelectedValue,
                uxSearchBooleanPanel.GetBoolSearchValue(),
                e);
        }

        if (filterType == SearchFilter.SearchFilterType.ValueRange)
        {
            PopulateValueRangeFilter(
                SearchFilter.SearchFilterType.ValueRange,
                uxFilterDrop.SelectedValue,
                uxSearchRangePanel.GetLowerValue(),
                uxSearchRangePanel.GetUpperValue(),
                e);
        }

        if (filterType == SearchFilter.SearchFilterType.Date)
        {
            PopulateValueRangeFilter(
                SearchFilter.SearchFilterType.Date,
                uxFilterDrop.SelectedValue,
                uxSearchDateRangePanel.GetStartDateText(),
                uxSearchDateRangePanel.GetEndDateText(),
                e);
        }
    }
    private void PopulateValueFilter(SearchFilter.SearchFilterType typeField,
                                     string value, string val1, EventArgs e)
    {
        SearchFilterObj = SearchFilter.GetFactory()
                          .WithFilterType(typeField)
                          .WithFieldName(value)
                          .WithValue1(val1)
                          .Create();

        if (typeField == SearchFilter.SearchFilterType.Text)
        {
            DisplayTextSearchMessage(SearchFilterObj.FieldName, SearchFilterObj.Value1);
        }
        else if (typeField == SearchFilter.SearchFilterType.Boolean)
        {
            DisplayBooleanSearchMessage(SearchFilterObj.FieldName, SearchFilterObj.Value1);
        }

        // Propagate event to parent
        OnBubbleEvent(e);
    }