protected override async Task OnInitializedAsync() { if (id == 0) { StoreInformation = new TotallyNotSmartPayModels.StoreInformation(); } else { StoreInformation = await StoreInformationDataService.GetStoreInformation(id); } }
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"); } }