private void LoadByBooks() { List <Book> bookList = bookManager.GetAll(); SequenceContent.Children.Clear(); foreach (var item in bookList) { Button buton = SeqBook.Get(item); SequenceContent.Children.Add(buton); } lblAllCount.Content = "Kayıtlı Toplam Kitap: " + bookList.Count; lblLibraryCount.Visibility = Visibility.Visible; lblLibraryCount.Content = "Kütüphanedeki Kitap: " + bookManager.GetAll().Where(i => i.BookLocation == 0).Count().ToString(); }
private void SearchBox_KeyDown(object sender, KeyEventArgs e) { TextBox textBox = sender as TextBox; SettingManager settingManager = new SettingManager(); Setting setting = settingManager.Get(2); bool durum = setting.State; if (e.Key == Key.Enter) { if (durum == false) { SequenceContent.Children.Clear(); if (SeqEntity is Book) { List <Book> books = bookManager.Search(textBox.Text); foreach (Book item in books) { Button button = SeqBook.Get(item); SequenceContent.Children.Add(button); } } else if (SeqEntity is Student) { List <Student> books = studentManager.Search(textBox.Text); foreach (Student item in books) { if (item.Identity == 0) { continue; } Button button = SeqStudent.Get(item); SequenceContent.Children.Add(button); } } } } }