Exemplo n.º 1
0
 public bool checkSimilarAddedSmartPhones(SmartPhonesControl SmartPhonesItem)
 {
     if (getSmartPhonesInBasket().Count != 0)
     {
         for (int i = 0; i < getSmartPhonesInBasket().Count; i++)
         {
             if (getSmartPhonesInBasket()[i].Title == SmartPhonesItem.Title)
             {
                 changeSmartPhonesControlsInBasket(SmartPhonesItem, getSmartPhonesInBasket()[i]);
                 return(true);
             }
         }
     }
     return(false);
 }
Exemplo n.º 2
0
        public void changeSmartPhonesControlsInBasket(SmartPhonesControl newSmartPhonesItem, SmartPhonesControl deleteSmartPhones)
        {
            int newQuantityCombo = newSmartPhonesItem.infoComboQuantitySelected() + deleteSmartPhones.infoComboQuantitySelected();

            if (newQuantityCombo > newSmartPhonesItem.infoComboQuantityAmount())
            {
                smartPhonesControlsInBasket.Remove(deleteSmartPhones);
                flowLayoutPanelBasket.Controls.Remove(deleteSmartPhones);
                smartPhonesControlsInBasket.Add(newSmartPhonesItem);
            }
            else
            {
                newSmartPhonesItem.setSelectedQuantity(newQuantityCombo);
                smartPhonesControlsInBasket.Remove(deleteSmartPhones);
                flowLayoutPanelBasket.Controls.Remove(deleteSmartPhones);
                smartPhonesControlsInBasket.Add(newSmartPhonesItem);
            }
        }
Exemplo n.º 3
0
 public void addSmartPhone(SmartPhonesControl smartPhone)
 {
     smartPhonesControlsInBasket.Add(smartPhone);
 }