예제 #1
0
        protected async Task HandleValidSubmit()
        {
            LecturerGroupDto result = null;

            if (LecturerGroup.LecturerGroupId != 0)
            {
                result = await LecturerGroupService.UpdateLecturerGroup(LecturerGroup);
            }
            else
            {
                result = await LecturerGroupService.CreateLecturerGroup(LecturerGroup);
            }
            NavigationManager.NavigateTo($"/lecturergroupsview");
        }
예제 #2
0
        /// <summary>
        /// inside this method we call the rest api and retrieve a data
        /// </summary>
        /// <returns></returns>
        protected async override Task OnInitializedAsync()
        {
            int.TryParse(Id, out int planId);

            if (planId != 0)
            {
                Plan = await PlanService.GetPlan(int.Parse(Id));

                AutumnSemester = Plan.AutumnSemester;
                SpringSemester = Plan.SpringSemester;

                Semesters = new List <SemesterDto> {
                    AutumnSemester, SpringSemester
                };

                SemesterId     = Semester.SemesterId.ToString();
                ModuleId       = Module.ModuleId.ToString();
                Lmr            = new LecturerModuleRunDto();
                SelectedPlanId = Plan.Id;
                ListLmr        = (await LecturerModuleRunService.GetLecturerModuleRuns()).ToList();
                foreach (var sem in Semesters)
                {
                    foreach (var mr in sem.ModuleRuns)
                    {
                        ModuleRuns.Add(mr);
                    }
                }
                await ShowLastYearPlan();
            }


            else
            {
                Plan     = new PlanDto {
                };
                Semester = new SemesterDto {
                };
                Module   = new ModuleDto {
                };
                ListLmr  = new List <LecturerModuleRunDto> {
                };
            }
            Plans          = (await PlanService.GetPlans()).ToList();
            ModuleRuns     = (await ModuleRunService.GetModuleRuns()).ToList();
            Modules        = (await ModuleService.GetModules()).ToList();
            Lecturers      = (await LecturerService.GetLecturers()).ToList();
            LecturerGroups = (await LecturerGroupService.GetLecturerGroups()).ToList();
        }
예제 #3
0
        protected async override Task OnInitializedAsync()
        {
            int.TryParse(Id, out int lecturerGroupId);

            if (lecturerGroupId != 0)
            {
                PageHeaderText = "Edit LecturerGroup";
                LecturerGroup  = await LecturerGroupService.GetLecturerGroup(int.Parse(Id));
            }
            else
            {
                PageHeaderText = "Create LecturerGroup";
                LecturerGroup  = new LecturerGroupDto
                {
                };
            }
            Lecturers = (await LecturerService.GetLecturers()).ToList();
        }
예제 #4
0
        protected async Task Delete_Click()
        {
            await LecturerGroupService.DeleteLecturerGroup(LecturerGroup.LecturerGroupId);

            NavigationManager.NavigateTo("/");
        }