Exemple #1
0
        public ProductArr Filter(Client client)
        {
            ProductArr productArr = new ProductArr();

            //לבדוק למה צריך פה פיל (לבדוק דרך הרפרנס)כ
            productArr.Fill();
            ProductArr productArr1 = new ProductArr();

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

                Product   product   = (productArr[i] as Product);
                ClientArr clientArr = new ClientArr();
                clientArr.Fill();
                Client client1 = clientArr.ReturnClientWithID(product.Client);
                if (

                    //סינון לפי מזהה הקלוח

                    client1.ID == client.ID
                    )

                {
                    //המוצר ענה לדרישות החיפוש - הוספה שלו לאוסף המוחזר

                    productArr1.Add(product);
                }
            }
            return(productArr1);
        }
Exemple #2
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);
        }