コード例 #1
0
 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);
 }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 public void addClothesItems(ClothesControl addClothesItems)
 {
     clothesControlsInBasket.Add(addClothesItems);
 }