Example #1
0
 public void Delete_book(string Data_book, string Data_reader)
 {
     if (Data_reader == null)
     {
         foreach (book i in books)
         {
             if (i.Get_information() == Data_book)
             {
                 books.Remove(books[books.IndexOf(i)]);
                 break;
             }
         }
     }
     else
     {
         this.Remove_book_reader(Data_reader, Data_book);
         foreach (book i in books)
         {
             if (i.Get_information() == Data_book)
             {
                 books.Remove(books[books.IndexOf(i)]);
                 break;
             }
         }
     }
     Library_main.Update_library();
 }
Example #2
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Form1());
     Library_main.Update_library();
 }
Example #3
0
 public void Remove_reader(string Data_reader)
 {
     foreach (reader i in readers)
     {
         if (i.Get_reader_information() == Data_reader)
         {
             List <book> Data_books = new List <book>();
             Data_books = i.Get_reader_books();
             foreach (book j in Data_books)
             {
                 foreach (book k in books)
                 {
                     if (j.Get_information() == k.Get_information())
                     {
                         books[books.IndexOf(k)].Change_Available();
                         break;
                     }
                 }
             }
             readers.Remove(i);
             break;
         }
     }
     Library_main.Update_library();
 }
Example #4
0
        public void New_Book(string Autor, string Name, string Publisher, string Year, string Code)
        {
            Autor     = Autor.Replace(" ", "_");
            Name      = Name.Replace(" ", "_");
            Publisher = Publisher.Replace(" ", "_");
            book New_book = new book(Autor, Name, Publisher, Year, Code);

            books.Add(New_book);
            Library_main.Update_library();
        }
Example #5
0
        public void New_Reader(string Name, string Surname, string Birthday)
        {
            Name    = Name.Replace(" ", "_");
            Surname = Surname.Replace(" ", "_");
            string DataTime   = Convert.ToString(DateTime.Today).Substring(0, 10);
            reader New_reader = new reader(Name, Surname, Birthday, DataTime);

            readers.Add(New_reader);
            Library_main.Update_library();
        }
Example #6
0
 public void New_code_book(string Data_book, string New_code)
 {
     foreach (book i in books)
     {
         if (i.Get_information() == Data_book)
         {
             books[books.IndexOf(i)].Change_code(New_code);
         }
     }
     Library_main.Update_library();
 }
Example #7
0
 public void Remove_book_reader(string Data_reader, string Data_book)
 {
     foreach (reader i in readers)
     {
         if (i.Get_reader_information() == Data_reader)
         {
             foreach (book j in books)
             {
                 if (j.Get_information() == Data_book)
                 {
                     readers[readers.IndexOf(i)].remove_reader_book(books[books.IndexOf(j)]);
                     books[books.IndexOf(j)].Change_Available();
                 }
             }
         }
     }
     Library_main.Update_library();
 }