예제 #1
0
        public OrderDetailsBuy GetOrderDetailsBuyWithMaxId()
        {
            OrderDetailsBuy orderDetailsBuy = new OrderDetailsBuy();

            for (int i = 0; i < this.Count; i++)
            {
                if ((this[i] as OrderDetailsBuy).Id > orderDetailsBuy.Id)
                {
                    orderDetailsBuy = this[i] as OrderDetailsBuy;
                }
            }
            return(orderDetailsBuy);
        }
예제 #2
0
        public bool Delete()
        {
            OrderDetailsBuy orderDetailsBuy = null;

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

                if (!orderDetailsBuy.Delete())
                {
                    return(false);
                }
            }
            return(true);
        }
예제 #3
0
        public OrderDetailsBuyArr Filter(CarExtra carExtra)
        {
            OrderDetailsBuyArr orderDetailsBuyArr = new OrderDetailsBuyArr();

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

                if ((carExtra == null) || (orderDetailsBuy.CarExtra.Id == carExtra.Id))
                {
                    orderDetailsBuyArr.Add(orderDetailsBuy);
                }
            }

            return(orderDetailsBuyArr);
        }
예제 #4
0
        public OrderDetailsBuyArr Filter(OrderBuy orderBuy)
        {
            OrderDetailsBuyArr orderDetailsBuyArr = new OrderDetailsBuyArr();

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

                if ((orderBuy == null) || (orderDetailsBuy.OrderBuy.Id == orderBuy.Id))
                {
                    orderDetailsBuyArr.Add(orderDetailsBuy);
                }
            }

            return(orderDetailsBuyArr);
        }
예제 #5
0
        public bool Insert()
        {
            //מוסיפה את אוסף המוצרים להזמנה למסד הנתונים

            bool            flag            = true;
            OrderDetailsBuy orderDetailsBuy = null;

            for (int i = 0; i < this.Count; i++)
            {
                orderDetailsBuy = (this[i] as OrderDetailsBuy);
                if (!orderDetailsBuy.Insert())
                {
                    flag = false;
                }
            }
            return(flag);
        }
예제 #6
0
        public void Fill()
        {
            DataTable dataTable = OrderDetailsBuy_DAL.GetDataTable();

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

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

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


                orderDetailsBuy = new OrderDetailsBuy(dataRow);

                this.Add(orderDetailsBuy);
            }
        }