Exemple #1
0
        public ClientArr Filter(int id, string lastName, string cellNumber)
        {
            ClientArr clientArr = new ClientArr();
            Client    client;

            for (int i = 0; i < this.Count; i++)
            {
                //הצבת הלקוח הנוכחי במשתנה עזר - לקוח

                client = (this[i] as Client);
                if
                (

                    // מזהה 0 – כלומר, לא נבחר מזהה בסינון

                    (id == 0 || client.ID == id) &&
                    client.LastName.StartsWith(lastName) &&
                    (client.CellPhone_AreaCode + client.PhoneNumber.ToString()).Contains(cellNumber)
                )
                {
                    //הלקוח ענה לדרישות הסינון - הוספת הלקוח לאוסף הלקוחות המוחזר

                    clientArr.Add(client);
                }
            }
            return(clientArr);
        }