Пример #1
0
        public ActionResult GradeBook(string listTermDate)
        {
            try
            {
                DateTime result;
                var      gradeBook   = new StudentGradeBook();
                bool     isValidDate = DateTime.TryParse(listTermDate, out result);

                if (isValidDate)
                {
                    IStudentGradeBookService gradeBookService = new StudentGradeBookService();
                    var termList = gradeBookService.GetStudentGradeBokkOfTerm(StudentNo);

                    IEnumerable <string> list = termList;

                    if (termList.Count != 0)
                    {
                        ViewData["TermsDateList"]       = new SelectList(list, listTermDate);
                        ViewData["IsGradeBookWeighted"] = gradeBookService.IsGradeBookWeighted();
                        gradeBook = gradeBookService.GetStudentGradeBookDetail(StudentNo, listTermDate);
                    }
                }

                return(View("GradeBook", gradeBook));
            }
            catch (Exception ex)
            {
                _logger.Error("Exception Occurred. StudentNo: " + StudentNo + " listTermDate: " + listTermDate, ex);

                Response.Redirect(AppHelper.SharedUrl("Reply/Error"));

                return(null);
            }
        }
Пример #2
0
        public ActionResult GradeBook()
        {
            try
            {
                IStudentGradeBookService gradeBookService = new StudentGradeBookService();
                var termList = gradeBookService.GetStudentGradeBokkOfTerm(StudentNo);

                IEnumerable <string> list = termList;

                var gradeBook = new StudentGradeBook();
                if (termList.Count != 0)
                {
                    ViewData["TermsDateList"]       = new SelectList(list, termList[0]);
                    ViewData["IsGradeBookWeighted"] = gradeBookService.IsGradeBookWeighted();
                    gradeBook = gradeBookService.GetStudentGradeBookDetail(StudentNo, termList[0]);
                }

                return(View(gradeBook));
            }
            catch (Exception ex)
            {
                _logger.Error("Exception Occurred. StudentNo: " + StudentNo, ex);

                Response.Redirect(AppHelper.SharedUrl("Reply/Error"));

                return(null);
            }
        }