Ejemplo n.º 1
0
        private void LoadByStudents()
        {
            List <Student> studentList = new List <Student>();

            try
            {
                studentList = studentManager.GetAll();
            }
            catch (Exception e)
            {
            }

            SequenceContent.Children.Clear();

            foreach (var item in studentList)
            {
                if (item.Identity == 0)
                {
                    continue;
                }
                Button buton = SeqStudent.Get(item);
                SequenceContent.Children.Add(buton);
            }
            lblAllCount.Content        = "Kayıtlı Toplam Öğrenci: " + (studentList.Count - 1);
            lblLibraryCount.Visibility = Visibility.Hidden;
        }
Ejemplo n.º 2
0
        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);
                        }
                    }
                }
            }
        }