Пример #1
0
        private void textBox1_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (patients != null && patients.Count != 0)
            {
                if (txSearch.Text.Length == 0)
                {
                    mDataGrid.ItemsSource = patients;

                    this.mDataGrid.CancelEdit();
                    this.mDataGrid.CancelEdit();
                    mDataGrid.Items.Refresh();
                    return;
                }

                var filtered = patients.Where(o => MContains.Check(o.NAME, txSearch.Text) || MContains.Check(o.SURNAME, txSearch.Text) ||
                                              MContains.Check(o.PERSONELID, txSearch.Text) || MContains.Check(o.ADRESS, txSearch.Text) ||
                                              MContains.Check(o.PHONE, txSearch.Text) || MContains.Check(o.GENDER, txSearch.Text) || MContains.Check(o.INSURANCENO, txSearch.Text));

                mDataGrid.ItemsSource = filtered;


                this.mDataGrid.CancelEdit();
                this.mDataGrid.CancelEdit();
                mDataGrid.Items.Refresh();
            }
        }
Пример #2
0
        private void textBox1_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (list != null && list.Count != 0)
            {
                if (txSearch.Text.Length == 0)
                {
                    mDataGrid.ItemsSource = list;

                    this.mDataGrid.CancelEdit();
                    this.mDataGrid.CancelEdit();
                    mDataGrid.Items.Refresh();
                    return;
                }

                var filtered = list.Where(o => MContains.Check(o.DOCTORFULLNAME, txSearch.Text) || MContains.Check(o.DOCTORFULLNAME, txSearch.Text) ||
                                          MContains.Check(o.PRICE.ToString(), txSearch.Text));

                mDataGrid.ItemsSource = filtered;


                this.mDataGrid.CancelEdit();
                this.mDataGrid.CancelEdit();
                mDataGrid.Items.Refresh();
            }
        }