public ClientArr GetClientArr() { ClientArr clientArr = new ClientArr(); OrderBuy orderBuy; for (int i = 0; i < this.Count; i++) { orderBuy = (this[i] as OrderBuy); //מוסיפים רק פריטים שלא קיימים כבר באוסף if (!clientArr.IsContains(orderBuy.Client)) { clientArr.Add(orderBuy.Client); } } return(clientArr); }
public ClientArr Filter(int id, string Name, string PhoneNumber) { ClientArr clientArr = new ClientArr(); for (int i = 0; i < this.Count; i++) { Client client = (this[i] as Client); if ( (id <= 0 || client.Id == id) && client.Fullname.Contains(Name) && (client.PhoneNumber.Contains(PhoneNumber)) ) { clientArr.Add(client); } } return(clientArr); }