コード例 #1
0
        public async void ConfirmDialog_OnDialogClose()
        {
            await StoreDataService.DeleteStore(this.SelectedStore.Id);

            Stores = (await StoreDataService.GetAllStores()).ToList();
            ToastService.ShowToast($"Store ''{this.SelectedStore.Name}'' has been deleted!", ToastLevel.Warning);
            //DisplayStatusAlert("alert-danger", $"Store ''{this.SelectedStore.Name}'' has been deleted!");

            await FilterStores();
            await ScrollToTop();
        }
コード例 #2
0
 private async Task FilterStores()
 {
     allStores = (await StoreDataService.GetAllStores()).ToList();
     int.TryParse(this.CategoryId, out var categoryId);
     if (categoryId == 0)
     {
         this.Stores = allStores;
     }
     else
     {
         if (allStores != null)
         {
             this.Stores = allStores.Where(store => store.CategoryId == categoryId.ToString()).ToList();
         }
     }
     this.SelectedStore = null;
     StateHasChanged();
 }