Exemplo n.º 1
0
        public OrderBuy GetOrderBuyWithMaxId()
        {
            OrderBuy orderBuy = new OrderBuy();

            for (int i = 0; i < this.Count; i++)
            {
                if ((this[i] as OrderBuy).Id > orderBuy.Id)
                {
                    orderBuy = this[i] as OrderBuy;
                }
            }
            return(orderBuy);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        public OrderBuyArr Filter(Client client)
        {
            OrderBuyArr orderBuyArr = new OrderBuyArr();

            for (int i = 0; i < this.Count; i++)
            {
                OrderBuy orderBuy = (this[i] as OrderBuy);
                if
                (
                    ((client == null) || (orderBuy.Client.Id == client.Id))
                )
                {
                    orderBuyArr.Add(orderBuy);
                }
            }
            return(orderBuyArr);
        }
Exemplo n.º 4
0
        public OrderBuyArr Filter(Product product)
        {
            OrderBuyArr orderBuyArr = new OrderBuyArr();

            for (int i = 0; i < this.Count; i++)
            {
                OrderBuy orderBuy = (this[i] as OrderBuy);
                if
                (
                    ((product == null) || (orderBuy.Product.Id == product.Id))
                )
                {
                    orderBuyArr.Add(orderBuy);
                }
            }
            return(orderBuyArr);
        }
Exemplo n.º 5
0
        public OrderBuyArr Filter(Employee employee, DateTime dateTime)
        {
            OrderBuyArr orderBuyArr = new OrderBuyArr();

            for (int i = 0; i < this.Count; i++)
            {
                OrderBuy orderBuy = (this[i] as OrderBuy);
                if
                (
                    ((employee == null) || (orderBuy.Employee.Id == employee.Id)) &&
                    ((orderBuy.DateOfBuy.Month == dateTime.Month) && (orderBuy.DateOfBuy.Year == dateTime.Year))
                )
                {
                    orderBuyArr.Add(orderBuy);
                }
            }
            return(orderBuyArr);
        }
Exemplo n.º 6
0
        public OrderBuyArr Filter(DateTime dt)
        {
            OrderBuyArr orderBuyArr = new OrderBuyArr();

            for (int i = 0; i < this.Count; i++)
            {
                OrderBuy orderBuy = (this[i] as OrderBuy);
                if
                (
                    (orderBuy.DateOfBuy.Year == dt.Year) &&
                    (orderBuy.DateOfBuy.Month == dt.Month)
                )
                {
                    orderBuyArr.Add(orderBuy);
                }
            }
            return(orderBuyArr);
        }
Exemplo n.º 7
0
        public OrderBuyArr Filter(Car car, DateTime dt)
        {
            OrderBuyArr orderBuyArr = new OrderBuyArr();

            for (int i = 0; i < this.Count; i++)
            {
                OrderBuy orderBuy = (this[i] as OrderBuy);
                if
                (
                    ((car == null) || (orderBuy.Product.Model.Id == car.Id)) &&
                    (orderBuy.DateOfBuy >= dt)
                )
                {
                    orderBuyArr.Add(orderBuy);
                }
            }
            return(orderBuyArr);
        }
Exemplo n.º 8
0
        public OrderBuyArr Filter(int id, string Client, DateTime Form, DateTime To)
        {
            OrderBuyArr orderBuyArr = new OrderBuyArr();

            for (int i = 0; i < this.Count; i++)
            {
                OrderBuy orderBuy = (this[i] as OrderBuy);
                if
                (
                    (id <= 0 || orderBuy.Id == id) &&
                    orderBuy.Client.Fullname.Contains(Client) &&
                    (orderBuy.DateOfBuy >= Form) &&
                    (orderBuy.DateOfBuy <= To)
                )
                {
                    orderBuyArr.Add(orderBuy);
                }
            }
            return(orderBuyArr);
        }
Exemplo n.º 9
0
        public void Fill()
        {
            DataTable dataTable = OrderBuy_DAL.GetDataTable();

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

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

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


                orderBuy = new OrderBuy(dataRow);

                this.Add(orderBuy);
            }
        }