public ThemeRowViewModel ChooseTheme(long subjectId, ThemeRowViewModel theme)
 {
     var userId = authorizationService.CurrentUser.Id;
     studentThemeService.Save(new StudentTheme
     {
         ThemeId = theme.Id,
         StudentId = userId,
         SubjectId = subjectId
     });
     universityUow.Commit();
     return theme;
 }
Пример #2
0
 public JsonResult ChooseTheme(long subjectId, ThemeRowViewModel theme)
 {
     var result = new AjaxViewModel();
     var isThemeAvailable = dashboardManagementService.IsThemeAvailable(subjectId, theme.Id);
     if (string.IsNullOrEmpty(isThemeAvailable))
     {
         result.Data = dashboardManagementService.ChooseTheme(subjectId, theme);
     }
     else
     {
         result.Errors.Add(isThemeAvailable);
     }
     return Json(result);
 }