Esempio n. 1
0
        public double GetBonus(DateTime dateTime, Employee employee)
        {
            double      Bonus       = 0;
            OrderBuyArr orderBuyArr = new OrderBuyArr();

            orderBuyArr.Fill();

            OrderRentArr orderRentArr = new OrderRentArr();

            orderRentArr.Fill();

            orderBuyArr  = orderBuyArr.Filter(employee, dateTime);
            orderRentArr = orderRentArr.Filter(employee, dateTime);

            for (int i = 0; i < orderBuyArr.Count; i++)
            {
                Bonus += (orderBuyArr[i] as OrderBuy).TotalPrice * 0.01;
            }
            for (int i = 0; i < orderRentArr.Count; i++)
            {
                Bonus += (orderRentArr[i] as OrderRent).TotalPrice * 0.01;
            }


            return(Bonus);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }
Esempio n. 4
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);
        }
Esempio n. 5
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);
        }
Esempio n. 6
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);
        }
Esempio n. 7
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);
        }