Esempio n. 1
0
        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;
            }
        }
Esempio n. 5
0
        protected async Task DeleteCourse(int id)
        {
            await PredmetiService.DeleteCourse(id);

            Courses.RemoveAll(c => c.Id == id);
        }
Esempio n. 6
0
 protected override async Task OnInitializedAsync()
 {
     Courses = await PredmetiService.GetCourses();
 }