public bool checkSimilarAddedTvs(TvsControl TvsItem) { if (getTvsInBasket().Count != 0) { for (int i = 0; i < getTvsInBasket().Count; i++) { if (getTvsInBasket()[i].Title == TvsItem.Title) { changeTvsControlsInBasket(TvsItem, getTvsInBasket()[i]); return(true); } } } return(false); }
public void changeTvsControlsInBasket(TvsControl newTvsItem, TvsControl deleteTvs) { int newQuantityCombo = newTvsItem.infoComboQuantitySelected() + deleteTvs.infoComboQuantitySelected(); if (newQuantityCombo > newTvsItem.infoComboQuantityAmount()) { tvsControlsInBasket.Remove(deleteTvs); flowLayoutPanelBasket.Controls.Remove(deleteTvs); tvsControlsInBasket.Add(newTvsItem); } else { newTvsItem.setSelectedQuantity(newQuantityCombo); tvsControlsInBasket.Remove(deleteTvs); flowLayoutPanelBasket.Controls.Remove(deleteTvs); tvsControlsInBasket.Add(newTvsItem); } }
public void addTvs(TvsControl tvs) { tvsControlsInBasket.Add(tvs); }