public ProductArr Filter(int Id, string LicenseNumber, string Status, Category category, Company company) { ProductArr productArr = new ProductArr(); for (int i = 0; i < this.Count; i++) { Product car = (this[i] as Product); if ( (Id <= 0 || car.Id == Id) && (car.LicenseNumber.Contains(LicenseNumber)) && (car.Status.Contains(Status)) && ((category == null) || (car.Model.Category.Id == category.Id)) && ((company == null) || (car.Model.Company.Id == company.Id)) ) { productArr.Add(car); if (Id > 0) { break; } } } productArr.Sort(); return(productArr); }
public ProductArr Filter(string Does) { ProductArr productArr = new ProductArr(); for (int i = 0; i < this.Count; i++) { Product car = (this[i] as Product); if (car.Doesavailable == Does) { productArr.Add(car); } } productArr.Sort(); return(productArr); }