Пример #1
0
 private void add_inner_to_db_Click(object sender, RoutedEventArgs e)
 {
     if (inner_title_box.Text != null &&
         inner_author_box.Text != null &&
         inner_level_text_box.Text != null &&
         inner_room_text_box.Text != null &&
         inner_type_text_box.Text != null &&
         inner_cover_url_box.Text != null &&
         inner_keywords_text_box.Text != null)
     {
         InnerMaterial innerMaterials = new InnerMaterial(InputFieldsManager.ReturnStringFromTextBox(inner_author_box), InputFieldsManager.ReturnStringFromTextBox(inner_title_box), InputFieldsManager.ReturnStringFromTextBox(inner_type_text_box), InputFieldsManager.ReturnStringFromTextBox(inner_keywords_text_box), Convert.ToInt32(InputFieldsManager.ReturnStringFromTextBox(inner_room_text_box)), Convert.ToInt32(InputFieldsManager.ReturnStringFromTextBox(inner_level_text_box)), InputFieldsManager.ReturnStringFromTextBox(inner_cover_url_box));
         LibrarianDataManager.AddInnerMaterial(innerMaterials);
         this.Close();
     }
 }
Пример #2
0
        public void Initialize()
        {
            LibrarianDataManager.ClearAll();

            LibrarianDataManager.AddLibrarian(new Librarian("LibrarianName", "LibrarianSurname", "80000000000", "Address"),
                                              "librarian_1", "12345");
            LibrarianDataManager.AddFaculty(new Faculty("FacultyName", "FacultySurname", "80000000000", "Address", ""),
                                            "patron_1", "12345");
            LibrarianDataManager.AddStudent(new Student("StudentName", "StudentSurname", "80000000000", "Address"),
                                            "patron_2", "12345");
            LibrarianDataManager.AddStudent(new Student("StudentName", "StudentSurname", "80000000000", "Address"),
                                            "patron_3", "12345");

            LibrarianDataManager.AddBook(new Book("Authors", "Book_1", "Publisher", "Edition", 2018, false, "Keys", "", 100));
            LibrarianDataManager.AddCopies(1, new Copy(1, 1, 1));
            LibrarianDataManager.AddBook(new Book("Authors", "Book_2", "Publisher", "Edition", 2018, true, "Keys", "", 50));
            LibrarianDataManager.AddCopies(2, new Copy(2, 1, 1));
            LibrarianDataManager.AddInnerMaterial(new InnerMaterial("Authors", "Book_3", "Book", "Keys", 1, 1, "https://"));
        }