private void searchByStayLimit() { string faculty = ""; string form = ""; string sl = ""; if (stayLimitComboBox.SelectedIndex != -1) { sl = stayLimitComboBox.SelectedValue.ToString(); } if (studentFac.SelectedIndex != -1) { faculty = studentFac.SelectedValue.ToString(); } if (Form.SelectedIndex != -1) { form = Form.SelectedValue.ToString(); } livingTable.ItemsSource = SearchFunctions.search_byStayLimit(globalConnection, sl, (bool)CheckBox1.IsChecked, (bool)CheckBox2.IsChecked, faculty, form); }
private void Page_Loaded(object sender, RoutedEventArgs e) { if (searchClass == 0) { serchString.Visibility = Visibility.Hidden; CheckBox1.Visibility = Visibility.Hidden; CheckBox2.Visibility = Visibility.Hidden; LivingLabel1.Visibility = Visibility.Hidden; livingLabel2.Visibility = Visibility.Hidden; livingLabel3.Visibility = Visibility.Hidden; livingLabel4.Visibility = Visibility.Hidden; livingParam.Visibility = Visibility.Hidden; roomParam.Visibility = Visibility.Hidden; Citizenship.Visibility = Visibility.Hidden; studentFac.Visibility = Visibility.Hidden; Form.Visibility = Visibility.Hidden; livingTable.Visibility = Visibility.Hidden; clearFilters.Visibility = Visibility.Hidden; roomLable1.Visibility = Visibility.Hidden; roomLabel2.Visibility = Visibility.Hidden; roomTable.Visibility = Visibility.Hidden; type.Visibility = Visibility.Hidden; checkBox3.Visibility = Visibility.Hidden; roomLabel3.Visibility = Visibility.Hidden; roomLabel4.Visibility = Visibility.Hidden; roomPlaces.Visibility = Visibility.Hidden; arcTable.Visibility = Visibility.Hidden; arcParam.Visibility = Visibility.Hidden; stayLimitLabel1.Visibility = Visibility.Hidden; stayLimitLabel2.Visibility = Visibility.Hidden; stayLimitComboBox.Visibility = Visibility.Hidden; stayLimitLabel3.Visibility = Visibility.Hidden; evictedP.Visibility = Visibility.Hidden; arcDate1.Visibility = Visibility.Hidden; arcDate2.Visibility = Visibility.Hidden; arcLabel1.Visibility = Visibility.Hidden; arcLabel2.Visibility = Visibility.Hidden; } if (searchClass == 1) { serchString.Visibility = Visibility.Hidden; CheckBox1.Visibility = Visibility.Visible; CheckBox2.Visibility = Visibility.Visible; LivingLabel1.Visibility = Visibility.Visible; livingLabel2.Visibility = Visibility.Visible; livingLabel3.Visibility = Visibility.Visible; livingLabel4.Visibility = Visibility.Visible; livingParam.Visibility = Visibility.Visible; roomParam.Visibility = Visibility.Hidden; Citizenship.Visibility = Visibility.Hidden; studentFac.Visibility = Visibility.Visible; Form.Visibility = Visibility.Visible; livingTable.Visibility = Visibility.Visible; clearFilters.Visibility = Visibility.Visible; roomLable1.Visibility = Visibility.Hidden; roomLabel2.Visibility = Visibility.Hidden; roomTable.Visibility = Visibility.Hidden; type.Visibility = Visibility.Hidden; checkBox3.Visibility = Visibility.Hidden; roomLabel3.Visibility = Visibility.Hidden; roomLabel4.Visibility = Visibility.Hidden; roomPlaces.Visibility = Visibility.Hidden; arcTable.Visibility = Visibility.Hidden; arcParam.Visibility = Visibility.Hidden; stayLimitLabel1.Visibility = Visibility.Hidden; stayLimitLabel2.Visibility = Visibility.Hidden; stayLimitComboBox.Visibility = Visibility.Hidden; stayLimitLabel3.Visibility = Visibility.Hidden; arcDate1.Visibility = Visibility.Hidden; arcDate2.Visibility = Visibility.Hidden; arcLabel1.Visibility = Visibility.Hidden; arcLabel2.Visibility = Visibility.Hidden; evictedP.Visibility = Visibility.Visible; evictedP.IsEnabled = false; CheckBox1.IsChecked = true; Search.SelectedIndex = 0; livingParam.SelectedIndex = -1; livingTable.ItemsSource = SearchFunctions.commonSearch(globalConnection, true, false, "", "", false); } if (searchClass == 2) { serchString.Visibility = Visibility.Hidden; CheckBox1.Visibility = Visibility.Visible; CheckBox2.Visibility = Visibility.Visible; LivingLabel1.Visibility = Visibility.Hidden; livingLabel2.Visibility = Visibility.Visible; livingLabel3.Visibility = Visibility.Visible; livingLabel4.Visibility = Visibility.Visible; livingParam.Visibility = Visibility.Visible; roomParam.Visibility = Visibility.Hidden; Citizenship.Visibility = Visibility.Hidden; studentFac.Visibility = Visibility.Visible; Form.Visibility = Visibility.Visible; livingTable.Visibility = Visibility.Visible; clearFilters.Visibility = Visibility.Visible; roomLable1.Visibility = Visibility.Hidden; roomLabel2.Visibility = Visibility.Hidden; roomTable.Visibility = Visibility.Hidden; type.Visibility = Visibility.Hidden; checkBox3.Visibility = Visibility.Hidden; roomLabel3.Visibility = Visibility.Hidden; roomLabel4.Visibility = Visibility.Hidden; roomPlaces.Visibility = Visibility.Hidden; arcTable.Visibility = Visibility.Hidden; arcParam.Visibility = Visibility.Hidden; stayLimitLabel1.Visibility = Visibility.Visible; stayLimitLabel2.Visibility = Visibility.Visible; stayLimitComboBox.Visibility = Visibility.Visible; stayLimitLabel3.Visibility = Visibility.Visible; arcDate1.Visibility = Visibility.Hidden; arcDate2.Visibility = Visibility.Hidden; arcLabel1.Visibility = Visibility.Hidden; arcLabel2.Visibility = Visibility.Hidden; evictedP.Visibility = Visibility.Visible; stayLimitComboBox.IsEnabled = false; CheckBox1.IsChecked = true; Search.SelectedIndex = 0; livingParam.SelectedIndex = 6; livingTable.ItemsSource = SearchFunctions.search_byStayLimit(globalConnection, "", true, false, "", ""); } if (searchClass == 3) { serchString.Visibility = Visibility.Hidden; CheckBox1.Visibility = Visibility.Visible; CheckBox2.Visibility = Visibility.Visible; LivingLabel1.Visibility = Visibility.Visible; livingLabel2.Visibility = Visibility.Visible; livingLabel3.Visibility = Visibility.Visible; livingLabel4.Visibility = Visibility.Visible; livingParam.Visibility = Visibility.Visible; roomParam.Visibility = Visibility.Hidden; Citizenship.Visibility = Visibility.Hidden; studentFac.Visibility = Visibility.Visible; Form.Visibility = Visibility.Visible; livingTable.Visibility = Visibility.Visible; clearFilters.Visibility = Visibility.Visible; roomLable1.Visibility = Visibility.Hidden; roomLabel2.Visibility = Visibility.Hidden; roomTable.Visibility = Visibility.Hidden; type.Visibility = Visibility.Hidden; checkBox3.Visibility = Visibility.Hidden; roomLabel3.Visibility = Visibility.Hidden; roomLabel4.Visibility = Visibility.Hidden; roomPlaces.Visibility = Visibility.Hidden; arcTable.Visibility = Visibility.Hidden; arcParam.Visibility = Visibility.Hidden; stayLimitLabel1.Visibility = Visibility.Hidden; stayLimitLabel2.Visibility = Visibility.Hidden; stayLimitComboBox.Visibility = Visibility.Hidden; stayLimitLabel3.Visibility = Visibility.Hidden; arcDate1.Visibility = Visibility.Hidden; arcDate2.Visibility = Visibility.Hidden; arcLabel1.Visibility = Visibility.Hidden; arcLabel2.Visibility = Visibility.Hidden; evictedP.Visibility = Visibility.Visible; evictedP.IsEnabled = true; evictedP.IsChecked = true; CheckBox1.IsChecked = false; Search.SelectedIndex = 0; livingParam.SelectedIndex = -1; livingTable.ItemsSource = SearchFunctions.search_exEvicted(globalConnection); //livingTable.ItemsSource = SearchFunctions.commonSearch(globalConnection, true, false, "", "", false); } }