コード例 #1
0
 public bool checkSimilarAddedSmartWatches(SmartWatchControl SmartWatchesItem)
 {
     if (getSmartWatchInBasket().Count != 0)
     {
         for (int i = 0; i < getSmartWatchInBasket().Count; i++)
         {
             if (getSmartWatchInBasket()[i].Title == SmartWatchesItem.Title)
             {
                 changeSmartWathesControlsInBasket(SmartWatchesItem, getSmartWatchInBasket()[i]);
                 return(true);
             }
         }
     }
     return(false);
 }
コード例 #2
0
        public void changeSmartWathesControlsInBasket(SmartWatchControl newSmartWatchesItem, SmartWatchControl deleteSmartWatches)
        {
            int newQuantityCombo = newSmartWatchesItem.infoComboQuantitySelected() + deleteSmartWatches.infoComboQuantitySelected();

            if (newQuantityCombo > newSmartWatchesItem.infoComboQuantityAmount())
            {
                smartWatchControlsInBasket.Remove(deleteSmartWatches);
                flowLayoutPanelBasket.Controls.Remove(deleteSmartWatches);
                smartWatchControlsInBasket.Add(newSmartWatchesItem);
            }
            else
            {
                newSmartWatchesItem.setSelectedQuantity(newQuantityCombo);
                smartWatchControlsInBasket.Remove(deleteSmartWatches);
                flowLayoutPanelBasket.Controls.Remove(deleteSmartWatches);
                smartWatchControlsInBasket.Add(newSmartWatchesItem);
            }
        }
コード例 #3
0
 public void addSmartWatch(SmartWatchControl smartWatch)
 {
     smartWatchControlsInBasket.Add(smartWatch);
 }