Ejemplo n.º 1
0
 public bool DoesExist(CarColor carColor)
 {
     for (int i = 0; i < this.Count; i++)
     {
         if ((this[i] as CarDesign).CarColor.Id == carColor.Id)
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
        public CarColor GetColorWithMaxId()
        {
            CarColor maxColor = new CarColor();

            for (int i = 0; i < this.Count; i++)
            {
                if ((this[i] as CarColor).Id > maxColor.Id)
                {
                    maxColor = this[i] as CarColor;
                }
            }
            return(maxColor);
        }
Ejemplo n.º 3
0
        public void Fill()
        {
            DataTable dataTable = CarColor_DAL.GetDataTable();
            CarColor  color     = new CarColor();
            DataRow   dataRow;

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

                color = new CarColor(dataRow);

                this.Add(color);
            }
        }
Ejemplo n.º 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);
        }