Пример #1
0
        private void buttonSearchChild_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (checkBoxChildByMom.IsChecked == true)
                {
                    childList = bl.getKids(a => a.idMom == (long)comboBoxChildByMom.SelectedValue);
                }
                else
                {
                    childList = bl.getKids();
                }

                if (checkBoxNotNanny.IsChecked == true)
                {
                    childList                 = from a in childList
                                        let x = a.idChild
                                                from b in bl.getAllChildWithoutNanny()
                                                where x == b.idChild
                                                select a;
                }

                if (checkBoxWithSpaiclNeed.IsChecked == true)
                {
                    childList                 = from a in childList
                                        let x = a.idChild
                                                from b in bl.getKids(b => b.isSpecialNeed == true)
                                                where x == b.idChild
                                                select a;
                }

                dataGridDetailsChild.ItemsSource = childList;
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message);
            }
        }