protected async Task HandleValidSubmit() { //Customer.CountryId = int.Parse(CountryId); //Customer.JobCategoryId = int.Parse(JobCategoryId); if (PhotoModel.PhotoModelID == 0) //new { var addedPhotoModel = await PhotoModelDataService.AddPhotoModel(PhotoModel); if (addedPhotoModel != null) { StatusClass = "alert-success"; Message = "Nieuwe klant succesvol toegevoegd."; Saved = true; } else { StatusClass = "alert-danger"; Message = "Er is iets misgegaan tijdens het aanmaken van een nieuwe klant. Probeer het opnieuw."; Saved = false; } } else { await PhotoModelDataService.UpdatePhotoModel(PhotoModel); StatusClass = "alert-success"; Message = "Klantgegevens zijn succesvol bijgewerkt."; Saved = true; } }
protected async Task DeleteCustomer() { await PhotoModelDataService.DeletePhotoModel(PhotoModel.PhotoModelID); StatusClass = "alert-success"; Message = "Deleted successfully"; Saved = true; }
//public List<Country> Countries { get; set; } = new List<Country>(); protected override async Task OnInitializedAsync() { Saved = false; //Countries = (await CountryDataService.GetAllCountries()).ToList(); int.TryParse(PhotoModelId, out var PhotoModelID); if (PhotoModelID == 0) //new Customer is being created { //add some defaults PhotoModel = new PhotoModel { }; } else { PhotoModel = await PhotoModelDataService.GetPhotoModelDetails(int.Parse(PhotoModelId)); } //CountryId = Customer.CountryId.ToString(); //JobCategoryId = Customer.JobCategoryId.ToString(); }
public async void QuickRegisterPhotoModel_OnDialogClose() { PhotoModels = (await PhotoModelDataService.GetAllPhotoModels()).ToList(); StateHasChanged(); }
protected override async Task OnInitializedAsync() { PhotoModels = (await PhotoModelDataService.GetAllPhotoModels()).ToList(); }
protected override async Task OnInitializedAsync() { PhotoModel = await PhotoModelDataService.GetPhotoModelDetails(int.Parse(PhotoModelId)); }