Beispiel #1
0
 public bool checkSimilarAddedBook(BooksControl addBooksItem)
 {
     if (getBooksInBasket().Count != 0)
     {
         for (int i = 0; i < getBooksInBasket().Count; i++)
         {
             if (getBooksInBasket()[i].Title == addBooksItem.Title)
             {
                 changeBooksControlsInBasket(addBooksItem, getBooksInBasket()[i]);
                 return(true);
             }
         }
     }
     return(false);
 }
Beispiel #2
0
        public void changeBooksControlsInBasket(BooksControl newBooksItem, BooksControl deleteBooks)
        {
            int newQuantityCombo = newBooksItem.infoComboQuantitySelected() + deleteBooks.infoComboQuantitySelected();

            if (newQuantityCombo > newBooksItem.infoComboQuantityAmount())
            {
                booksControlsInBasket.Remove(deleteBooks);
                flowLayoutPanelBasket.Controls.Remove(deleteBooks);  // delete from flowlayout old string of data
                booksControlsInBasket.Add(newBooksItem);
            }
            else
            {
                newBooksItem.setSelectedQuantity(newQuantityCombo);
                booksControlsInBasket.Remove(deleteBooks);
                flowLayoutPanelBasket.Controls.Remove(deleteBooks);  // delete from flowlayout old string of data
                booksControlsInBasket.Add(newBooksItem);
            }
        }
Beispiel #3
0
 public void addBooksItems(BooksControl addBooksItems)
 {
     booksControlsInBasket.Add(addBooksItems);
 }