internal List<OrderBike> GetOrderBikeList() //is used to get all Bike Orders NEED TO TRY { List<OrderBike> orderBikeList = new List<OrderBike>(); var orderList = DataBase.GetFromDB("Order_Bikes"); var orderDetailList = DataBase.GetFromDB("Order_Details"); SetBikeModelList(); foreach (var row in orderList) { List<List<string>> details = new List<List<string>>(orderDetailList.FindAll(x => x[6] == row[0]));//takes each lists with the same order_Id OrderBike newOrder = new OrderBike(row[1], details, Int32.Parse(row[0]), Convert.ToDateTime(row[3]), Convert.ToDateTime(row[4]), Int32.Parse(row[2]),bikeModels); orderBikeList.Add(newOrder);//row[1] is the column where the name of the client is put } return orderBikeList; }
internal List<OrderBike> getOrderBikeList() //is used to get all Bike Orders NEED TO TRY { List<OrderBike> orderBikeList = new List<OrderBike>(); var orderList = getFromDB("Order_Bikes"); var orderDetailList = getFromDB("Order_Details"); updateBikeModelList(); foreach (var row in orderList) { List<List<string>> details = new List<List<string>>(orderDetailList.FindAll(x => x[6] == row[0]));//takes each lists with the same order_Id OrderBike newOrder = new OrderBike(row[1], details, Int32.Parse(row[0]), Convert.ToDateTime(row[3]), Convert.ToDateTime(row[4]), Int32.Parse(row[2]),bikeModels); //maybe put those 3 into a SET method inside orderBike /*newOrder.orderDate = Convert.ToDateTime(row[3]); newOrder.shippingDate = Convert.ToDateTime(row[4]); newOrder.totalPrice = Int32.Parse(row[2]);*/ orderBikeList.Add(newOrder);//row[1] is the column where the name of the client is put } return orderBikeList; }