Esempio n. 1
0
        public IActionResult AddStudentToGroup(StudentDto studentDto)
        {
            try
            {
                var groupId = (int)TempData["groupId"];

                _studentService.AddStudentToGroup(studentDto, groupId);

                return(RedirectToAction($"Details/{groupId}"));
            }
            catch (Exception e)
            {
                if (e is ArgumentNullException || e is ArgumentException)
                {
                    ViewBag.Info = e.Message;
                    return(View());
                }

                return(View("Error"));
            }
        }