예제 #1
0
파일: Form1.cs 프로젝트: admirall32/Library
        private void fillIn() //заполняет библиотеку
        {
            library.AddReader(new Reader("Иванов Н.С.", 0, "Юридический",
                                         new DateTime(2000, 10, 6), "240-00-50", library));
            library.AddReader(new Reader("Петров А.Е.", 1, "Юридический",
                                         new DateTime(2001, 12, 26), "240-00-51", library));
            library.AddReader(new Reader("Сидоров В.П.", 2, "Управление",
                                         new DateTime(1999, 11, 16), "240-00-52", library));

            foreach (Reader reader in library.GetReaders())
            {
                ReadersComboBox.Items.Add(reader.Name);
            }

            library.AddBook(new Book("Почта духов", "Иван Крылов"));
            library.AddBook(new Book("Зритель", "Иван Крылов"));
            library.AddBook(new Book("Меркурий", "Иван Крылов"));
            library.AddBook(new Book("Государство", "Василий Жуковский"));
            library.AddBook(new Book("Азбука", "Лев Толстой"));
            library.AddBook(new Book("Песенник", "Лев Толстой"));
        }
        static void PrepareReaders(Library library)
        {
            Reader reader1 = new Reader("Jerzy", "Nowak");
            Reader reader2 = new Reader("Anna", "Niewińska");
            Reader reader3 = new Reader("Ewa", "Kacprowicz");
            Reader reader4 = new Reader("Gabriel", "Ilczuk");
            Reader reader5 = new Reader("Maciej", "Koc");
            Reader reader6 = new Reader("Przemysław", "Niedzielski");
            Reader reader7 = new Reader("Irena", "Poniedziałek");

            library.AddReader(reader1);
            library.AddReader(reader2);
            library.AddReader(reader3);
            library.AddReader(reader4);
            library.AddReader(reader5);
            library.AddReader(reader6);
            library.AddReader(reader7);
        }