private void livingSerch() { switch (livingParam.SelectedIndex) { case (-1): commonSearch(); break; case (0): livingTable.ItemsSource = SearchFunctions.search_byFIOall(globalConnection, serchString.Text, (bool)CheckBox1.IsChecked); break; case (1): courseSearch(); break; case (2): try { livingTable.ItemsSource = SearchFunctions.search_ByID(globalConnection, serchString.Text.ToString()); } catch { MessageBox.Show("Неверный формат номера студенческого билета"); } break; case (3): livingTable.ItemsSource = SearchFunctions.search_ByRoomNumber(globalConnection, serchString.Text.ToString()); break; case (4): if (Citizenship.SelectedIndex != -1) { citizenSearch(); } break; case (5): livingTable.ItemsSource = SearchFunctions.search_ByDecreeNumber(globalConnection, serchString.Text.ToString()); break; case (6): searchByStayLimit(); break; } }