private void idSearch(object sender, RoutedEventArgs e) { Message.Content = ""; Resource resource = new Resource(); List <Resource> resources = new List <Resource>(); if (autoCompleteBoxId.Text != "") { resource = window.database.GetResource(autoCompleteBoxId.Text); if (resource != null) { resources.Add(resource); window.ResourcePins_Draw2(resources); this.Close(); } else { Message.Content = "Nema resursa sa ovim ID-ijem."; } } else { Message.Content = "Molimo unesite ID resursa."; } }
private void NameSearchh(object sender, RoutedEventArgs e) { Message.Content = ""; Resource resource = new Resource(); if (autoCompleteBoxName.Text != "") { List<Resource> resources = window.database.searchName(autoCompleteBoxName.Text); if (resources.Count() > 0) { Message.Content = ""; window.ResourcePins_Draw2(resources); this.Close(); } else { Message.Content = "Nema resursa sa ovim nazivom."; } } else { Message.Content = "Morate uneti naziv resursa."; } }
private void tagSearch(object sender, RoutedEventArgs e) { Message.Content = ""; List <Resource> resources = new List <Resource>(); if (autoCompleteBoxTags.Text != "") { resources = window.database.searchTag(autoCompleteBoxTags.Text); if (resources.Count() > 0) { window.ResourcePins_Draw2(resources); this.Close(); } else { Message.Content = "Nema resursa sa ovom etiketom."; } } else { Message.Content = "Molimo odaberite ID etikete."; } }
private void filter(object sender, RoutedEventArgs e) { Message.Content = ""; List <string> criteria = new List <string>(); int i = 0; if ((bool)(radioButtonInside.IsChecked)) { criteria.Add("obnovljiv"); i++; } if ((bool)(Importance.IsChecked)) { criteria.Add("vazan"); i++; } if ((bool)(AbleToExploate.IsChecked)) { criteria.Add("exp"); i++; } if ((bool)(Merica.IsChecked)) { criteria.Add("merica"); i++; } if ((bool)(Tona.IsChecked)) { criteria.Add("tona"); i++; } if ((bool)(Kilogram.IsChecked)) { criteria.Add("kilogram"); i++; } if ((bool)(Barel.IsChecked)) { criteria.Add("barel"); i++; } if ((bool)(Redak.IsChecked)) { criteria.Add("redak"); i++; } if ((bool)(Cest.IsChecked)) { criteria.Add("cest"); i++; } if ((bool)(Univerzalan.IsChecked)) { criteria.Add("univerzalan"); i++; } if (i == 0) { Message.Content = "Štiklirajte bar jedno od ponuđenih polja."; return; } List <Resource> res = window.database.filter(criteria); if (res.Count() > 0) { window.ResourcePins_Draw2(res); this.Close(); } else { Message.Content = "Nema resursa koji isunjavaju neki od kriterijuma."; } }