public IActionResult GradesManage(long id, GradeUpdateModel gradeUpdateModel) { switch (gradeUpdateModel.Action) { case GradeActions.SetCompetences: _gradeService.UpdateCompetencesForGrade(gradeUpdateModel, id); break; case GradeActions.RemoveGrade: _gradeService.RemoveGrade(id); return(RedirectToAction("Grades")); case GradeActions.AddGrade: _gradeService.AddNextGrade(gradeUpdateModel, id); break; } gradeUpdateModel = _gradeService.GetGradeUpdateModelFor(id); ViewBag.UpdatedGrade = gradeUpdateModel.GradeModel; return(View(gradeUpdateModel)); }