private void AcademicDetailsAreEdited()
        {
            var editAcademicDetailsPanel = _profilePage.EditAcademicDetails();

            _editAcademicDetailsModel = new EditAcademicDetailsModelBuilder().Build();
            editAcademicDetailsPanel.Edit(_editAcademicDetailsModel);
        }
 public void Map(EditAcademicDetailModel source, StudentAcademicDetail target, string performanceHistoryFilePath)
 {
     target.ReadingScore = source.ReadingScore;
     target.WritingScore = source.WritingScore;
     target.MathScore = source.MathScore;
     target.PerfomanceHistory = source.PerformanceHistory;
     if (performanceHistoryFilePath != null) target.PerformanceHistoryFile = performanceHistoryFilePath;
 }
        public virtual JsonResult ValidateEditedAcademicDetails(EditAcademicDetailModel AcademicDetail)
        {
            if (!ModelState.IsValid)
            {
                var nglErrors = ModelState.GetNglErrors();

                return Json(new { nglErrors }, JsonRequestBehavior.AllowGet);
            }

            return Json(true, JsonRequestBehavior.AllowGet);
        }
        public virtual ActionResult EditAcademicDetails(int studentUsi, EditAcademicDetailModel academicDetail)
        {
            if (!ModelState.IsValid)
            {
                TempData["ShowSuccess"] = false;
                return RedirectToAction(MVC.Student.Index(studentUsi));
            }

            var fileCategory = academicDetail.SchoolYear.ToString(CultureInfo.InvariantCulture);
            var performanceHistoryFileName = _fileUploader.Upload(academicDetail.PerformanceHistoryFileUrl, studentUsi, fileCategory, "performanceHistory");

            var student = _studentRepository.GetByUSI(studentUsi);
            var studentAcademicDetail = student.StudentAcademicDetails.First();

            _editAcademicDetailModelToStudentAcademicDetailMapper.Map(academicDetail, studentAcademicDetail, performanceHistoryFileName);

            _repository.Save();

            TempData["ShowSuccess"] = true;
            return RedirectToAction(MVC.Student.Index(studentUsi));
        }