コード例 #1
0
        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;
            }
        }
コード例 #2
0
        protected async Task DeleteCustomer()
        {
            await PhotoModelDataService.DeletePhotoModel(PhotoModel.PhotoModelID);

            StatusClass = "alert-success";
            Message     = "Deleted successfully";

            Saved = true;
        }
コード例 #3
0
        //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();
        }
コード例 #4
0
 public async void QuickRegisterPhotoModel_OnDialogClose()
 {
     PhotoModels = (await PhotoModelDataService.GetAllPhotoModels()).ToList();
     StateHasChanged();
 }
コード例 #5
0
 protected override async Task OnInitializedAsync()
 {
     PhotoModels = (await PhotoModelDataService.GetAllPhotoModels()).ToList();
 }
コード例 #6
0
 protected override async Task OnInitializedAsync()
 {
     PhotoModel = await PhotoModelDataService.GetPhotoModelDetails(int.Parse(PhotoModelId));
 }