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); }
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); } }
public void addSmartWatch(SmartWatchControl smartWatch) { smartWatchControlsInBasket.Add(smartWatch); }