private async Task ExecuteLoadOrdersCommand() { if (IsBusy) { return; } IsBusy = true; try { Orders.Clear(); var items = await OrdersDataStore.GetItemsAsync(true); Orders.ReplaceRange(items); } catch (Exception ex) { Debug.WriteLine(ex); MessagingCenter.Send(new MessagingCenterAlert { Title = "Error", Message = "Unable to load Orders.", Cancel = "OK" }, "message"); } finally { IsBusy = false; } }
public GetAllShould(OrdersDataStoreSharedFixture fixture, ITestOutputHelper output) { this.fixture = fixture; this.fixture.Setup(output); sut = fixture.CreateDataStore(); }
public ExternalSimCardOrdersData(string connectionString) { var options = Options.Create <ExternalSimCardsProvider.Api.Configuration.Config>(new ExternalSimCardsProvider.Api.Configuration.Config() { ConnectionString = connectionString }); ordersDataStore = new OrdersDataStore(options); }
public OrdersViewModel() { Title = "Orders"; MessagingCenter.Subscribe <OrderEditPage, Order>(this, "AddOrder", async(obj, order) => { var _order = (Order)order; Orders.Add(_order); await OrdersDataStore.AddItemAsync(_order); }); }
public void InsertOrder(Order order) { var options = Options.Create(new Config { ConnectionString = connectionString }); sut = new OrdersDataStore(options); output.WriteLine($"Inserting Order with Reference={order.Reference}"); using var tx = sut.BeginTransaction(); sut.Add(order); orders.Add(order); }