Exemplo n.º 1
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);
                }
            }
        }
Exemplo n.º 2
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);
        }