コード例 #1
0
ファイル: Delivery2.cs プロジェクト: ilshat-fatkhullin/LISy
        public void D2TC1()
        {
            LibrarianDataManager.ClearAll();
            LibrarianDataManager.AddLibrarian(new Librarian("LibrarianName", "LibrarianSurname", "80000000000", "Address"),
                                              "librarian_1", "12345");
            LibrarianDataManager.AddFaculty(new Faculty("Sergey", "Afonso", "30001", "ViaMargutta, 3", ""),
                                            "patron_1", "12345");
            LibrarianDataManager.AddStudent(new Student("Nadia", "Teixeira", "30002", "Via Sacra, 13"),
                                            "patron_2", "12345");
            LibrarianDataManager.AddStudent(new Student("Elvira", "Espindola", "30003", "Via del Corso, 22"),
                                            "patron_3", "12345");

            LibrarianDataManager.AddBook(new Book("Authors", "Book_1", "Publisher", "Edition", 2018, false, "Keys", "", 100));
            LibrarianDataManager.AddCopies(3, new Copy(1, 1, 1));
            LibrarianDataManager.AddBook(new Book("Authors", "Book_2", "Publisher", "Edition", 2018, false, "Keys", "", 100));
            LibrarianDataManager.AddCopies(2, new Copy(2, 1, 2));
            LibrarianDataManager.AddBook(new Book("Authors", "Book_3", "Publisher", "Edition", 2018, false, "Keys", "", 100));
            LibrarianDataManager.AddCopies(1, new Copy(3, 1, 3));
            LibrarianDataManager.AddAVMaterial(new AVMaterial("Authors", "AVMaterial_1", "Keys", "", 100));
            LibrarianDataManager.AddCopies(1, new Copy(4, 1, 4));
            LibrarianDataManager.AddAVMaterial(new AVMaterial("Authors", "AVMaterial_2", "Keys", "", 100));
            LibrarianDataManager.AddCopies(1, new Copy(5, 1, 5));

            Assert.AreEqual(LibrarianDataManager.GetNumberOfCopies(), 8);
            Assert.AreEqual(LibrarianDataManager.GetNumberOfUsers(), 4);
        }
コード例 #2
0
        private void av_add_to_db_Click(object sender, RoutedEventArgs e)
        {
            if (av_title_text_box.Text != null &&
                authors_av_text_box.Text != null &&
                av_room_text_box.Text != null &&
                av_level_text_box.Text != null &&
                av_copy_text_box.Text != null &&
                av_key_words_text_box.Text != null &&
                av_price_text_box.Text != null &&
                av_coverURL_text_box.Text != null)
            {
                AVMaterial av_material  = new AVMaterial(InputFieldsManager.ReturnStringFromTextBox(authors_av_text_box), InputFieldsManager.ReturnStringFromTextBox(av_title_text_box), InputFieldsManager.ReturnStringFromTextBox(av_key_words_text_box), InputFieldsManager.ReturnStringFromTextBox(av_coverURL_text_box), Convert.ToInt32(InputFieldsManager.ReturnStringFromTextBox(av_price_text_box)));
                long       avMaterialId = LibrarianDataManager.AddAVMaterial(av_material);

                Copy copy = new Copy();
                int  n    = Convert.ToInt32(InputFieldsManager.ReturnStringFromTextBox(av_copy_text_box));
                copy.DocumentId = avMaterialId;
                copy.Room       = Convert.ToInt32(InputFieldsManager.ReturnStringFromTextBox(av_room_text_box));
                copy.Level      = Convert.ToInt32(InputFieldsManager.ReturnStringFromTextBox(av_level_text_box));
                LibrarianDataManager.AddCopies(n, copy);

                this.Close();
            }
        }
コード例 #3
0
        public void Initialization()
        {
            LibrarianDataManager.ClearAll();
            LibrarianDataManager.AddBook(new Book(
                                             "Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein",
                                             "Introduction to Algorithms",
                                             "MIT Press",
                                             "Third edition",
                                             2009,
                                             false,
                                             "Algorithms",
                                             "",
                                             5000
                                             ));
            LibrarianDataManager.AddBook(new Book(
                                             "Erich Gamma, Ralph Johnson, John Vlissides, Richard Helm",
                                             "Design Patterns: Elements of Reusable Object-Oriented Software",
                                             "Addison-Wesley Professional",
                                             "First edition",
                                             2003,
                                             true,
                                             "Algorithms",
                                             "",
                                             1700
                                             ));
            LibrarianDataManager.AddAVMaterial(new AVMaterial(
                                                   "Tony Hoare",
                                                   "Null References: The Billion DollarMistake",
                                                   "",
                                                   "",
                                                   700));
            LibrarianDataManager.AddCopies(3, new Copy(1, 1, 1));
            LibrarianDataManager.AddCopies(3, new Copy(2, 1, 1));
            LibrarianDataManager.AddCopies(2, new Copy(3, 1, 1));

            LibrarianDataManager.AddFaculty(new Faculty(
                                                "Sergey",
                                                "Afonso",
                                                "30001",
                                                "ViaMargutta, 3",
                                                Faculty.PROFESSOR_SUBTYPE
                                                ), "patron_1", "12345");
            LibrarianDataManager.AddFaculty(new Faculty(
                                                "Nadia",
                                                "Teixeira",
                                                "30002",
                                                "Via Sacra, 13",
                                                Faculty.PROFESSOR_SUBTYPE
                                                ), "patron_2", "12345");
            LibrarianDataManager.AddFaculty(new Faculty(
                                                "Elvira",
                                                "Espindola",
                                                "30003",
                                                "Via del Corso, 22",
                                                Faculty.PROFESSOR_SUBTYPE
                                                ), "patron_3", "12345");
            LibrarianDataManager.AddStudent(new Student(
                                                "Andrey",
                                                "Velo",
                                                "30004",
                                                "AvenidaMazatlan 250"
                                                ), "patron_4", "12345");
            LibrarianDataManager.AddGuest(new Guest(
                                              "Veronika",
                                              "Rama",
                                              "30005",
                                              "Stret Atocha, 27"
                                              ), "patron_5", "12345");
            LibrarianDataManager.AddLibrarian(new Librarian(
                                                  "LibrarianName",
                                                  "LibrarianSurname",
                                                  "30006",
                                                  "LibrarianAddress"
                                                  ), "librarian_1", "12345");
        }