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); }
public ProductArr Filter(Car car, DateTime dt) { ProductArr productArr = new ProductArr(); for (int i = 0; i < this.Count; i++) { Product product = (this[i] as Product); if ( ((car == null) || (product.Model.Id == car.Id)) ) { productArr.Add(product); } } return(productArr); }
public ProductArr Filter(Company company) { ProductArr productArr = new ProductArr(); for (int i = 0; i < this.Count; i++) { Product car = (this[i] as Product); if ((company == null) || (car.Model.Company.Id == company.Id)) { productArr.Add(car); } } return(productArr); }
public ProductArr GetProductArr() { ProductArr productArr = new ProductArr(); OrderBuy orderBuy; for (int i = 0; i < this.Count; i++) { orderBuy = (this[i] as OrderBuy); //מוסיפים רק פריטים שלא קיימים כבר באוסף if (!productArr.IsContains(orderBuy.Product)) { productArr.Add(orderBuy.Product); } } return(productArr); }
public ProductArr Filter(Car car, DateTime dt) { ProductArr productArr = new ProductArr(); for (int i = 0; i < this.Count; i++) { OrderRent orderRent = (this[i] as OrderRent); if ( ((car == null) || (orderRent.Product.Model.Id == car.Id)) && (orderRent.DateFrom > dt) ) { productArr.Add(orderRent); } } return(productArr); }