Esempio n. 1
0
        public OrderDetailsRent GetOrderDetailsRentWithMaxId()
        {
            OrderDetailsRent orderDetailsRent = new OrderDetailsRent();

            for (int i = 0; i < this.Count; i++)
            {
                if ((this[i] as OrderDetailsRent).Id > orderDetailsRent.Id)
                {
                    orderDetailsRent = this[i] as OrderDetailsRent;
                }
            }
            return(orderDetailsRent);
        }
Esempio n. 2
0
        public bool Delete()
        {
            OrderDetailsRent orderDetailsRent = null;

            for (int i = 0; i < this.Count; i++)
            {
                orderDetailsRent = (this[i] as OrderDetailsRent);

                if (!orderDetailsRent.Delete())
                {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 3
0
        public OrderDetailsRentArr Filter(CarExtra carExtra)
        {
            OrderDetailsRentArr orderDetailsRentArr = new OrderDetailsRentArr();

            for (int i = 0; i < this.Count; i++)
            {
                OrderDetailsRent orderDetailsRent = (this[i] as OrderDetailsRent);

                if ((carExtra == null) || (orderDetailsRent.CarExtra.Id == carExtra.Id))
                {
                    orderDetailsRentArr.Add(orderDetailsRent);
                }
            }

            return(orderDetailsRentArr);
        }
Esempio n. 4
0
        public OrderDetailsRentArr Filter(OrderRent orderRent)
        {
            OrderDetailsRentArr orderDetailsRentArr = new OrderDetailsRentArr();

            for (int i = 0; i < this.Count; i++)
            {
                OrderDetailsRent orderDetailsRent = (this[i] as OrderDetailsRent);

                if ((orderRent == null) || (orderDetailsRent.OrderRent.Id == orderRent.Id))
                {
                    orderDetailsRentArr.Add(orderDetailsRent);
                }
            }

            return(orderDetailsRentArr);
        }
Esempio n. 5
0
        public bool Insert()
        {
            //מוסיפה את אוסף המוצרים להזמנה למסד הנתונים

            bool             flag             = true;
            OrderDetailsRent orderDetailsRent = null;

            for (int i = 0; i < this.Count; i++)
            {
                orderDetailsRent = (this[i] as OrderDetailsRent);
                if (!orderDetailsRent.Insert())
                {
                    flag = false;
                }
            }
            return(flag);
        }
Esempio n. 6
0
        public void Fill()
        {
            DataTable dataTable = OrderDetailsRent_DAL.GetDataTable();

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

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

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


                orderDetailsRent = new OrderDetailsRent(dataRow);

                this.Add(orderDetailsRent);
            }
        }