Exemple #1
0
 public bool checkSimilarAddedLaptopsPcs(LaptopsPcsControl laptopsPcsItem)
 {
     if (getLaptopsPcsInBasket().Count != 0)
     {
         for (int i = 0; i < getLaptopsPcsInBasket().Count; i++)
         {
             if (getLaptopsPcsInBasket()[i].Title == laptopsPcsItem.Title)
             {
                 changeLaptopsPcsControlsInBasket(laptopsPcsItem, getLaptopsPcsInBasket()[i]);
                 return(true);
             }
         }
     }
     return(false);
 }
Exemple #2
0
        public void changeLaptopsPcsControlsInBasket(LaptopsPcsControl newLaptopsPcsItem, LaptopsPcsControl deletelaptopsPcsControls)
        {
            int newQuantityCombo = newLaptopsPcsItem.infoComboQuantitySelected() + deletelaptopsPcsControls.infoComboQuantitySelected();

            if (newQuantityCombo > newLaptopsPcsItem.infoComboQuantityAmount())
            {
                laptopsPcsControlsInBasket.Remove(deletelaptopsPcsControls);
                flowLayoutPanelBasket.Controls.Remove(deletelaptopsPcsControls); // delete from flowlayout old string of data
                laptopsPcsControlsInBasket.Add(newLaptopsPcsItem);
            }
            else
            {
                newLaptopsPcsItem.setSelectedQuantity(newQuantityCombo);
                laptopsPcsControlsInBasket.Remove(deletelaptopsPcsControls);
                flowLayoutPanelBasket.Controls.Remove(deletelaptopsPcsControls); // delete from flowlayout old string of data
                laptopsPcsControlsInBasket.Add(newLaptopsPcsItem);
            }
        }
Exemple #3
0
 public void addLaptopsPcsItems(LaptopsPcsControl addLaptopsPcs)
 {
     laptopsPcsControlsInBasket.Add(addLaptopsPcs);
 }