public void Map(EnterProgramStatusModel source, StudentProgramStatus target,
            ProgramStatusUploadedFilePaths filePaths)
        {
            target.TestingAccommodation = source.TestingAccommodation.GetValueOrDefault();
            target.BilingualProgram = source.BilingualProgram.GetValueOrDefault();
            target.EnglishAsSecondLanguage = source.EnglishAsSecondLanguage.GetValueOrDefault();
            target.SchoolFoodServicesEligibilityTypeId = (int)source.FoodServicesEligibilityStatus;
            target.Gifted = source.Gifted.GetValueOrDefault();
            target.SpecialEducation = source.SpecialEducation.GetValueOrDefault();
            target.TitleParticipation = source.TitleParticipation.GetValueOrDefault();
            target.McKinneyVento = source.McKinneyVento.GetValueOrDefault();

            target.TitleParticipationFile = filePaths.TitleParticipation ?? NewFilePath(source.TitleParticipation, target.TitleParticipationFile);
            target.TestingAccommodationFile = filePaths.TestingAccomodation ?? NewFilePath(source.TestingAccommodation, target.TestingAccommodationFile);
            target.SpecialEducationFile = filePaths.SpecialEducation ?? NewFilePath(source.SpecialEducation, target.SpecialEducationFile);
            target.McKinneyVentoFile = filePaths.McKinneyVento ?? NewFilePath(source.McKinneyVento.GetValueOrDefault(), target.McKinneyVentoFile);
        }
Ejemplo n.º 2
0
        public virtual ActionResult EditProgramStatus(int studentUsi, EnterProgramStatusModel programStatus)
        {
            var specialEducationFileName    = _fileUploader.Upload(programStatus.SpecialEducationFile, studentUsi, "ProgramStatus", "specialEducation");
            var testingAccomodationFileName = _fileUploader.Upload(programStatus.TestingAccommodationFile, studentUsi, "ProgramStatus", "testingAccomodation");
            var titleParticipationFileName  = _fileUploader.Upload(programStatus.TitleParticipationFile, studentUsi, "ProgramStatus", "titleParticipation");
            var mcKinneyVentoFileName       = _fileUploader.Upload(programStatus.McKinneyVentoFile, studentUsi, "ProgramStatus", "mcKinneyVento");

            var filePaths = new ProgramStatusUploadedFilePaths(specialEducationFileName, testingAccomodationFileName,
                                                               titleParticipationFileName, mcKinneyVentoFileName);

            var studentProgramStatus = _repository.Get <StudentProgramStatus>(sps => sps.StudentUSI == studentUsi);

            _programStatusModelToProgramStatusForEditMapper.Map(programStatus, studentProgramStatus, filePaths);

            _repository.Save();

            TempData["ShowSuccess"] = true;
            return(RedirectToAction(MVC.Student.Index(studentUsi)));
        }
Ejemplo n.º 3
0
        public virtual ActionResult EditProgramStatus(int studentUsi, EnterProgramStatusModel programStatus)
        {
            var specialEducationFileName = _fileUploader.Upload(programStatus.SpecialEducationFile, studentUsi, "ProgramStatus", "specialEducation");
            var testingAccomodationFileName = _fileUploader.Upload(programStatus.TestingAccommodationFile, studentUsi, "ProgramStatus", "testingAccomodation");
            var titleParticipationFileName = _fileUploader.Upload(programStatus.TitleParticipationFile, studentUsi, "ProgramStatus", "titleParticipation");
            var mcKinneyVentoFileName = _fileUploader.Upload(programStatus.McKinneyVentoFile, studentUsi, "ProgramStatus", "mcKinneyVento");

            var filePaths = new ProgramStatusUploadedFilePaths(specialEducationFileName, testingAccomodationFileName,
                titleParticipationFileName, mcKinneyVentoFileName);

            var studentProgramStatus = _repository.Get<StudentProgramStatus>(sps => sps.StudentUSI == studentUsi);
            _programStatusModelToProgramStatusForEditMapper.Map(programStatus, studentProgramStatus, filePaths);

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