Ejemplo n.º 1
0
        //public async Task<Store> UpdateStoreAsync(Store store)
        //{
        //    if (!initialized)
        //        await Init();

        //    await storeTable.UpdateAsync(store);
        //    await SyncStoresAsync();
        //    await MobileService.SyncContext.PushAsync();
        //    return store;
        //}

        public async Task <CommonYelpClass> UpdateStoreAsync(CommonYelpClass store)
        {
            if (!initialized)
            {
                await Init();
            }

            await storeTable.UpdateAsync(store);

            await SyncStoresAsync();

            await MobileService.SyncContext.PushAsync();

            return(store);
        }
Ejemplo n.º 2
0
        //public async Task<bool> RemoveStoreAsync(Store store)
        //{
        //    if (!initialized)
        //        await Init();

        //    await storeTable.DeleteAsync(store);
        //    await SyncStoresAsync();
        //    await MobileService.SyncContext.PushAsync();
        //    return true;
        //}

        public async Task <bool> RemoveStoreAsync(CommonYelpClass store)
        {
            if (!initialized)
            {
                await Init();
            }

            await storeTable.DeleteAsync(store);

            await SyncStoresAsync();

            await MobileService.SyncContext.PushAsync();

            return(true);
        }
Ejemplo n.º 3
0
        // public StorePage(Store store)
        public StorePage(CommonYelpClass store)
        {
            InitializeComponent();

            BindingContext = viewModel = new StoreViewModel(store, this);

            if (Device.RuntimePlatform != Device.UWP)
            {
                MyMap = new Map
                {
                    IsShowingUser = false,
                    MapType       = MapType.Hybrid
                };
                MainGrid.Children.Add(MyMap);
                // Grid.SetRow(MyMap, 14);
                Grid.SetRow(MyMap, 6);
                Grid.SetColumnSpan(MyMap, 3);
            }
        }
Ejemplo n.º 4
0
        // public async Task DeleteStore(Store store)
        public async Task DeleteStore(CommonYelpClass store)
        {
            if (IsBusy)
            {
                return;
            }
            IsBusy = true;
            try
            {
                await dataStore.RemoveStoreAsync(store);

                Stores.Remove(store);
                Sort();
            }
            catch (Exception ex)
            {
                await page.DisplayAlert("Uh Oh :(", $"Unable to remove {store?.Name ?? "Unknown"}, please try again: {ex.Message}", "OK");
            }
            finally
            {
                IsBusy = false;
            }
        }
Ejemplo n.º 5
0
 public StoreViewModel(CommonYelpClass store, Page page) : base(page)
 {
     this.Store = store;
 }