public async Task AddCourse() { var response = await PredmetiService.AddCourse(Course); if (response != null) { NavigationManager.NavigateTo("/courses"); } }
protected async Task UpdateCourse() { var response = await PredmetiService.UpdateCourse(Id, Course); if (response != null) { NavigationManager.NavigateTo($"/courses/{Id}/details"); } }
protected override async Task OnInitializedAsync() { try { Course = await PredmetiService.GetCourse(Id); FetchSuccess = true; } catch (Exception) { FetchSuccess = false; } }
protected override async Task OnInitializedAsync() { try { Student = await StudentiService.GetStudentView(Id); Courses = await PredmetiService.GetCoursesView(); FetchSuccess = true; } catch (Exception) { FetchSuccess = false; } }
protected async Task DeleteCourse(int id) { await PredmetiService.DeleteCourse(id); Courses.RemoveAll(c => c.Id == id); }
protected override async Task OnInitializedAsync() { Courses = await PredmetiService.GetCourses(); }