protected override async Task OnInitializedAsync() { if (id == 0) { StoreInformation = new TotallyNotSmartPayModels.StoreInformation(); } else { StoreInformation = await StoreInformationDataService.GetStoreInformation(id); } }
public async Task DeleteStore(int id) { if (await JS.InvokeAsync <bool>("confirm", "Are you sure you want to mark this store as deleted?")) { if (await JS.InvokeAsync <bool>("exampleJsFunctions.deleteStoreDisplayNumber", AllStores.Where(x => x.Id == id).FirstOrDefault().StoreNumber)) { await StoreInformationDataService.MarkAsDeleted(id); } } //StateHasChanged(); NavigationManager.NavigateTo($"/storeinformation", forceLoad: true); }
protected async Task HandleValidSubmit() { if (StoreInformation.Id == 0) { StoreInformation = await StoreInformationDataService.InsertNewStore(StoreInformation); } else { StoreInformation = await StoreInformationDataService.UpdateStore(StoreInformation); } if (StoreInformation == null) { StatusClass = "alert-danger"; Message = "Something went wrong trying to save. Refresh the page and try again."; } else { NavigationManager.NavigateTo("/storeinformation"); } }
protected override async Task OnInitializedAsync() { AllStores = await StoreInformationDataService.GetAllStores(); Columns = Helpers.GetPropertyNames(AllStores.FirstOrDefault()); }