Exemple #1
0
        public async Task Add()
        {
            await PulpitService.AddAsync(Current).ConfigureAwait(false);

            Collection = await PulpitService.GetAsync().ConfigureAwait(false);

            StateHasChanged();
        }
Exemple #2
0
        public async Task Update()
        {
            if (Collection is List <Pulpit> pulpits)
            {
                pulpits[pulpits.FindIndex(r => r.Id == Current.Id)] = Current;
            }
            else
            {
                Collection = await PulpitService.GetAsync().ConfigureAwait(false);
            }

            StateHasChanged();
            Current = await PulpitService.UpdateAsync(Current).ConfigureAwait(false);
        }
        public async Task ShowModal(int id)
        {
            Current = await LecturerService.GetAsync(id).ConfigureAwait(false);

            Current.Pulpits = await PulpitService.GetAsync();
        }
 public async Task ShowModal()
 {
     Current = new Lecturer {
         Pulpits = await PulpitService.GetAsync()
     };
 }
Exemple #5
0
 public async Task Delete(int id)
 {
     Collection = Collection.Where(r => r.Id != id).ToList();
     StateHasChanged();
     await PulpitService.DeleteAsync(id).ConfigureAwait(false);
 }
Exemple #6
0
        public async Task ShowModal(int id)
        {
            Current = await PulpitService.GetAsync(id).ConfigureAwait(false);

            Current.Faculties = await FacultyService.GetAsync();
        }
Exemple #7
0
 protected override async Task OnInitAsync()
 {
     Collection = await PulpitService.GetAsync().ConfigureAwait(false);
 }