public bool checkSimilarAddedLaptopsPcs(LaptopsPcsControl laptopsPcsItem) { if (getLaptopsPcsInBasket().Count != 0) { for (int i = 0; i < getLaptopsPcsInBasket().Count; i++) { if (getLaptopsPcsInBasket()[i].Title == laptopsPcsItem.Title) { changeLaptopsPcsControlsInBasket(laptopsPcsItem, getLaptopsPcsInBasket()[i]); return(true); } } } return(false); }
public void changeLaptopsPcsControlsInBasket(LaptopsPcsControl newLaptopsPcsItem, LaptopsPcsControl deletelaptopsPcsControls) { int newQuantityCombo = newLaptopsPcsItem.infoComboQuantitySelected() + deletelaptopsPcsControls.infoComboQuantitySelected(); if (newQuantityCombo > newLaptopsPcsItem.infoComboQuantityAmount()) { laptopsPcsControlsInBasket.Remove(deletelaptopsPcsControls); flowLayoutPanelBasket.Controls.Remove(deletelaptopsPcsControls); // delete from flowlayout old string of data laptopsPcsControlsInBasket.Add(newLaptopsPcsItem); } else { newLaptopsPcsItem.setSelectedQuantity(newQuantityCombo); laptopsPcsControlsInBasket.Remove(deletelaptopsPcsControls); flowLayoutPanelBasket.Controls.Remove(deletelaptopsPcsControls); // delete from flowlayout old string of data laptopsPcsControlsInBasket.Add(newLaptopsPcsItem); } }
public void addLaptopsPcsItems(LaptopsPcsControl addLaptopsPcs) { laptopsPcsControlsInBasket.Add(addLaptopsPcs); }