Example #1
0
        public List <object> Search(CriteriaLine criteria = null)
        {
            if (_selectProperties.SelectedIndex > 0)
            {
                _searchList.Select(_selectProperties.GetSelectedProperties());
            }

            /*if (SelectProperties.SelectedProperty.IsList)
             * SearchList.Select(SelectProperties.SelectedProperty.Name, SelectProperties.SelectedProperty.Type.GetGenericArguments()[0]);
             * else
             * SearchList.Select(SelectProperties.SelectedProperty.Name, SelectProperties.SelectedProperty.Type);*/
            else
            {
                _searchList.ResetSelect();
            }

            _searchList.Search(SelectionPanel.BuildQuery());
            _searchList.SubListSearch(SearchPanel.BuildQuery(criteria));
            if (criteria == null)
            {
                _searchList.OrderBy(OrderByPanel.BuildQuery());
            }

            return(_searchList.GetResults());
        }
Example #2
0
        private void SelectSubListChanged(object sender, EventArgs e)
        {
            if (SelectProperties.SelectedIndex > 0)
            {
                SelectionPanel.Visible = true;
                if (SelectionPanel.Criteria.Count == 0)
                {
                    SelectionPanel.AddNew();
                }
            }
            else
            {
                SelectionPanel.Visible = false; SelectionPanel.Clear();
            }

            Type selectedType = SelectProperties.GetLowestPropertyType();

            if (selectedType.IsGenericType)
            {
                selectedType = selectedType.GetGenericArguments()[0];
            }

            SearchPanel.Clear();
            SearchPanel.CriteriaType = selectedType;
            SearchPanel.AddNew();

            OrderByPanel.Clear();
            OrderByPanel.CriteriaType = selectedType;
            OrderByPanel.AddNew();
            PanelResized(this, null);

            if (SelectProperties.SelectedIndex > 0)
            {
                if (selectedType == typeof(Site) || selectedType == typeof(Battle))
                {
                    btnMapResults.Visible = true;
                }
                else
                {
                    btnMapResults.Visible = false;
                }
            }
            else if (SelectProperties.ParentType == typeof(Site) || SelectProperties.ParentType == typeof(Battle))
            {
                btnMapResults.Visible = true;
            }
            else
            {
                btnMapResults.Visible = false;
            }

            //if (SelectProperties.SelectedIndex != 0)
            //    lblSearchCriteria.Text = "Search " + SelectProperties.Text + " Where:";
            //else
            //    lblSearchCriteria.Text = "Search " + SelectList.Text + " Where:";
        }
Example #3
0
        public List <object> Search(CriteriaLine criteria = null)
        {
            if (_selectProperties.SelectedIndex > 0)
            {
                _searchList.Select(_selectProperties.GetSelectedProperties());
            }
            else
            {
                _searchList.ResetSelect();
            }

            _searchList.Search(SelectionPanel.BuildQuery());
            _searchList.SubListSearch(SearchPanel.BuildQuery(criteria));
            if (criteria == null)
            {
                _searchList.OrderBy(OrderByPanel.BuildQuery());
            }

            return(_searchList.GetResults());
        }