public void CreateOrders() { if (OrdersList.Count != 0) { OrdersList.Clear(); } for (var i = 0; i < OrderCount; i++) { var random = new Random(); while (true) { var order = _ordersDataList.ElementAt(random.Next(0, _ordersDataList.Count)); var orderRepeat = OrdersList.FirstOrDefault(x => x.key == order.key); if (OrdersList.Count == 0 || orderRepeat == null) { OrdersList.Add(order); } else { continue; } break; } } }
private void LoadOrders(List <OrderLoadObject> orders) { foreach (var orderData in orders) { var order = _ordersDataList.First(x => x.key == orderData.key); order.isComplete = orderData.isComplete; OrdersList.Add(order); } }
public async Task ListOrders() { APIResponse response = await GetOrders.ExecuteStrategy(null); if (response.IsSuccess) { var jsonSerializerSettings = new JsonSerializerSettings(); jsonSerializerSettings.MissingMemberHandling = MissingMemberHandling.Ignore; Orders = JsonConvert.DeserializeObject <List <OrderModel> >(response.Response, jsonSerializerSettings); foreach (var o in Orders) { OrdersList.Add(o); } } }
private async void CreateNewOrder() { OrderModel newOrder = null; await Task.Run(() => { newOrder = serviceRepository.CreateNewOrder(); }); if (newOrder != null) { OrdersList.Add(newOrder); SelectedOrder = newOrder; EventAggregator.GetEvent <OrderCreated>().Publish(); } }
public void AddOrder(Order order) { OrdersList.Add(order); }
public void addNewOrder(Order order) { OrdersList.Add(order); }