Beispiel #1
0
        public void ListReadingOrderMethod()
        {
            var OrderDetailListFromBase = new ObservableCollection <OrderDetailsList>(orderOperationsObj.GetAllDetailProductListFromBase());

            Console.WriteLine($"Order Detail List : {OrderDetailListFromBase.Count}");
            for (int i = 0; i < OrdersList.Count; i++)
            {
                Console.Write($"Order List ID :{OrdersList[i].Id}");
                OrdersList[i].TotalAmount = 0;
                ObservableCollection <OrderDetailsList> selectedItems = new ObservableCollection <OrderDetailsList>();
                Console.WriteLine("proba dodania do selected items");
                foreach (var item in OrderDetailListFromBase)
                {
                    if (OrdersList[i].Id == item.OrderId)
                    {
                        Console.WriteLine($"Czy rowna sie null image ? {item.Image == null}");
                        selectedItems.Add(item);
                        OrdersList[i].TotalAmount += item.Value;
                    }
                }

                Console.WriteLine(OrdersList[i].Status);
                ListReadingOrder.Add(new Order {
                    Id = OrdersList[i].Id, OrderCreate = OrdersList[i].OrderCreate, DispatchDate = OrdersList[i].DispatchDate, CustomerId = OrdersList[i].CustomerId, TotalAmount = OrdersList[i].TotalAmount, OrderDetailsLists = selectedItems, Customer = OrdersList[i].Customer, Status = OrdersList[i].Status, DeliveryName = OrdersList[i].DeliveryName, DeliveryStreet = OrdersList[i].DeliveryStreet, DeliveryPostcode = OrdersList[i].DeliveryPostcode, DeliveryCity = OrdersList[i].DeliveryCity, DeliveryCountry = OrdersList[i].DeliveryCountry
                });
            }
        }