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); } } }
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); }
public void FillRentAvailable() { DataTable dataTable = Product_DAL.GetDataTable(); //להעביר את הערכים מהטבלה לתוך אוסף הלקוחות //להעביר כל שורה בטבלה ללקוח DataRow dataRow; Product product; OrderRent orderRent; OrderRentArr orderRentArr = new OrderRentArr(); orderRentArr.Fill(); // orderRentArr = orderRentArr.FilterNoReturned(); for (int i = 0; i < dataTable.Rows.Count; i++) { dataRow = dataTable.Rows[i]; product = new Product(dataRow); for (int j = 0; j < orderRentArr.Count; j++) { orderRent = orderRentArr[j] as OrderRent; if ( (product.Status == "Rent") && (orderRent.Product.Id != product.Id) && (orderRent.Product.Doesavailable == "InRent") ) { this.Add(product); } } } }