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); }
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); }
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); } }
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); }