Example #1
0
 public bool DoesExist(BodyDesign bodyDesign)
 {
     for (int i = 0; i < this.Count; i++)
     {
         if ((this[i] as CarDesign).BodyDesign.Id == bodyDesign.Id)
         {
             return(true);
         }
     }
     return(false);
 }
Example #2
0
        public BodyDesign GetBodyDesignWithMaxId()
        {
            BodyDesign maxColor = new BodyDesign();

            for (int i = 0; i < this.Count; i++)
            {
                if ((this[i] as BodyDesign).Id > maxColor.Id)
                {
                    maxColor = this[i] as BodyDesign;
                }
            }
            return(maxColor);
        }
Example #3
0
        public void Fill()
        {
            DataTable  dataTable  = BodyDesign_DAL.GetDataTable();
            BodyDesign bodyDesign = new BodyDesign();
            DataRow    dataRow;

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                dataRow = dataTable.Rows[i];

                bodyDesign = new BodyDesign(dataRow);

                this.Add(bodyDesign);
            }
        }
Example #4
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);
        }