public bool checkSimilarAddedClothes(ClothesControl addClothesItem) { if (getClothesInBasket().Count != 0) { for (int i = 0; i < getClothesInBasket().Count; i++) { if (getClothesInBasket()[i].Title == addClothesItem.Title) { changeClothesControlsInBasket(addClothesItem, getClothesInBasket()[i]); return(true); } } } return(false); }
public void changeClothesControlsInBasket(ClothesControl newClothesItem, ClothesControl deleteClothes) { int newQuantityCombo = newClothesItem.infoComboQuantitySelected() + deleteClothes.infoComboQuantitySelected(); if (newQuantityCombo > newClothesItem.infoComboQuantityAmount()) { clothesControlsInBasket.Remove(deleteClothes); flowLayoutPanelBasket.Controls.Remove(deleteClothes); // delete from flowlayout old string of data clothesControlsInBasket.Add(newClothesItem); } else { newClothesItem.setSelectedQuantity(newQuantityCombo); clothesControlsInBasket.Remove(deleteClothes); flowLayoutPanelBasket.Controls.Remove(deleteClothes); // delete from flowlayout old string of data clothesControlsInBasket.Add(newClothesItem); } }
public void addClothesItems(ClothesControl addClothesItems) { clothesControlsInBasket.Add(addClothesItems); }