Example #1
0
        public IActionResult EditStudentGrades(int?id)
        {
            ViewBag.StudentId = id.Value;

            if (id == null)
            {
                return(View("NotFound"));
            }

            var CoursesList = studentCourseRepository.StudentCourses(id.Value);

            var model = new List <EditStudentGradesViewModel>();

            foreach (var item in CoursesList)
            {
                var editStudentGradesViewModel = new EditStudentGradesViewModel
                {
                    CourseId    = item.CourseId,
                    CourseCode  = item.CourseCode,
                    CourseName  = item.CourseName,
                    CourseHours = item.CourseHours,
                    CourseGPA   = item.CourseGPA
                };

                model.Add(editStudentGradesViewModel);
            }

            return(View(model));
        }