Beispiel #1
0
        public void FillBuyAvailable()
        {
            DataTable dataTable = Product_DAL.GetDataTable();

            //להעביר את הערכים מהטבלה לתוך אוסף הלקוחות

            //להעביר כל שורה בטבלה ללקוח
            DataRow dataRow;
            Product product;

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                dataRow = dataTable.Rows[i];

                product = new Product(dataRow);

                if (
                    (product.Status == "Buy") &&
                    (product.Doesavailable == "")
                    )
                {
                    this.Add(product);
                }
            }
        }
Beispiel #2
0
        public void FillRentAvailable(DateTime From, DateTime To)
        {
            DataTable dataTable = Product_DAL.GetDataTable();


            DataRow dataRow;
            Product product;

            OrderRentArr orderRentArr = new OrderRentArr();

            orderRentArr.Fill();

            //  orderRentArr = orderRentArr.FilterNoReturned();
            orderRentArr = orderRentArr.Filter(From, To);

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                dataRow = dataTable.Rows[i];

                product = new Product(dataRow);



                if (
                    (product.Status == "Rent") &&
                    (!orderRentArr.DoesExist(product))
                    )
                {
                    this.Add(product);
                }
            }
        }
Beispiel #3
0
        public void Fill()
        {
            //להביא מה-DAL טבלה מלאה בכל הלקוחות

            DataTable dataTable = Product_DAL.GetDataTable();

            //להעביר את הערכים מהטבלה לתוך אוסף הלקוחות
            //להעביר כל שורה בטבלה ללקוח

            DataRow dataRow;
            Product product;

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                dataRow = dataTable.Rows[i];
                product = new Product(dataRow);
                this.Add(product);
            }
        }
Beispiel #4
0
        public void FillRentAvailable()
        {
            DataTable dataTable = Product_DAL.GetDataTable();

            //להעביר את הערכים מהטבלה לתוך אוסף הלקוחות

            //להעביר כל שורה בטבלה ללקוח
            DataRow   dataRow;
            Product   product;
            OrderRent orderRent;

            OrderRentArr orderRentArr = new OrderRentArr();

            orderRentArr.Fill();

            // orderRentArr = orderRentArr.FilterNoReturned();

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                dataRow = dataTable.Rows[i];

                product = new Product(dataRow);

                for (int j = 0; j < orderRentArr.Count; j++)
                {
                    orderRent = orderRentArr[j] as OrderRent;

                    if (
                        (product.Status == "Rent") &&
                        (orderRent.Product.Id != product.Id) &&
                        (orderRent.Product.Doesavailable == "InRent")
                        )
                    {
                        this.Add(product);
                    }
                }
            }
        }