コード例 #1
0
        protected override void search_btn_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            List <SearchParams> list = new List <SearchParams>();

            foreach (SearchParamsControls spc in stackPanel.Children)
            {
                String conditionalOperator = spc.Operator_Combobox.ItemsSource == null ? null : spc.Operator_Combobox.SelectedItem.ToString();

                int    fieldComboBoxidx = spc.Field_Combobox.SelectedIndex;
                int    operatoor        = spc.ComparisonOperators_Combobox.SelectedIndex;
                String value            = spc.ValueField.Text;

                SearchParams temp = new SearchParams();
                temp.FieldID             = Columns.ElementAt(fieldComboBoxidx).FieldID;
                temp.ConditionalOperator = conditionalOperator;
                temp.OperatorID          = ComparisonOperators.ElementAt(operatoor).OperatorID;
                temp.Value = value;

                list.Add(temp);
            }

            DataTable dt = SearchFrameworkHelper.Search(list);

            if (dt != null)
            {
                dataGrid.ItemsSource = dt.DefaultView;
            }
            else
            {
                MessageBox.Show("Logical Error");
            }
        }
コード例 #2
0
        private void CoursePage_btn_Click(object sender, RoutedEventArgs e)
        {
            List <Columns> columns = SearchFrameworkHelper.GetColumns(3);

            Entities.Pages page = SearchFrameworkHelper.GetPage(3);
            new Page1(page, operators, columns, comp_operators).Show();
        }
コード例 #3
0
        public page_design(Entities.Pages pageInfo, String [] operators, List <Columns> columns, List <Operators> compOperators)
        {
            InitializeComponent();
            this.operators = operators;

            this.RunningPage = pageInfo;

            this.fields = (from c in columns select c.DisplayName).ToArray <String>();
            this.comparison_operators = (from c in compOperators select c.OperatorName).ToArray <String>();

            this.ComparisonOperators = compOperators;
            this.Columns             = columns;

            stackPanel             = new StackPanel();
            stackPanel.Orientation = Orientation.Vertical;
            param_grid.Content     = stackPanel;
            new SearchParamsControls(this, stackPanel, null, fields, comparison_operators);
            dataGrid.ItemsSource = SearchFrameworkHelper.FetchAllDataOfPage(RunningPage).DefaultView;
        }
コード例 #4
0
 public MainWindow()
 {
     InitializeComponent();
     comp_operators = SearchFrameworkHelper.GetOperators();
 }
コード例 #5
0
 private void reset_button_Click(object sender, RoutedEventArgs e)
 {
     stackPanel.Children.Clear();
     new SearchParamsControls(this, stackPanel, null, fields, comparison_operators);
     dataGrid.ItemsSource = SearchFrameworkHelper.FetchAllDataOfPage(RunningPage).DefaultView;
 }