コード例 #1
0
        public CarDesignArr GetCarDesignArr()
        {
            CarDesignArr carDesignArr = new CarDesignArr();

            OrderBuy orderBuy;

            for (int i = 0; i < this.Count; i++)
            {
                orderBuy = (this[i] as OrderBuy); //מוסיפים רק פריטים שלא קיימים כבר באוסף
                if (!carDesignArr.IsContains(orderBuy.CarDesign))
                {
                    carDesignArr.Add(orderBuy.CarDesign);
                }
            }

            return(carDesignArr);
        }
コード例 #2
0
        public CarDesignArr Filter(CarColor carColor, ColorType colorTypes, BodyDesign bodyDesign)
        {
            CarDesignArr carDesignArr = new CarDesignArr();

            for (int i = 0; i < this.Count; i++)
            {
                CarDesign carDesign = (this[i] as CarDesign);
                if
                (
                    ((carColor == null) || (carDesign.CarColor.Id == carColor.Id)) &&
                    ((colorTypes == null) || (carDesign.ColorType.Id == colorTypes.Id)) &&
                    ((bodyDesign == null) || (carDesign.BodyDesign.Id == bodyDesign.Id))
                )
                {
                    carDesignArr.Add(carDesign);
                }
            }
            return(carDesignArr);
        }