/// <summary> /// 根据学生ID获取初访数据 /// </summary> /// <param name="studentID">学生ID</param> /// <returns></returns> public JsonResult GetFirstInterviewRegData(string studentID) { if (studentID == null || studentID == string.Empty) { return Json(false, JsonRequestBehavior.AllowGet); } Guid id = new Guid(studentID); StudentInfoEntity studentInfo = repository.StudentInfo.SingleOrDefault(s => s.StudentID == id); AppRelationsEntity appRelation = repository.AppRelation.SingleOrDefault(a => a.StudentID == id); StudentTPInfoEntity studentTP = GetStudentTP(id); ExamResultTFIELTSModel tfIELTSModel = GetTFIELTSExamResult(id); ExamResultSATSSATModel satSSATModel = GetSATSSATExamResult(id); ExamResultEntity sat2Model = GetSAT2ExamResult(id); ExamResultGREGMATModel greGmatModel = GetGREGMATExamResult(id); ExamResultEntity apModel = GetAPResult(id); IEnumerable<StudentSourceItemEntity> studentSourceList = GetStudentSourceList(); IEnumerable<StudentFromEntity> studentFromList = GetStudentFromList(id); IEnumerable<StudentFlashPointEntity> studentFlashPointList = GetFlashPointList(id); FirstInterviewRegModel firstInterviewRegMode = new FirstInterviewRegModel { StudentInfo = studentInfo, AppRelation = appRelation, StudentTPInfo = studentTP, TFIELTSResult = tfIELTSModel.ExamResult, TFIELTSResultDetail = tfIELTSModel.ExamResultDetail, SATSSATResult = satSSATModel.ExamResult, SATSSATResultDetail = satSSATModel.ExamResultDetail, SAT2Result = sat2Model, GREGMATResult = greGmatModel.ExamResult, GREGMATResultDetail = greGmatModel.ExamResultDetail, APResult = apModel, StudentSourceList = studentSourceList, StudentFromList = studentFromList, StudentFlashPointList = studentFlashPointList }; return Json(firstInterviewRegMode, JsonRequestBehavior.AllowGet); }
public JsonResult PostFirstInterviewRegTPForm(FirstInterviewRegModel ajaxData) { if (ajaxData == null || ajaxData.StudentInfo == null) return Json(false); StudentTPInfoEntity studentTPInfo = ajaxData.StudentTPInfo; StudentInfoEntity studentInfo = repository.StudentInfo.SingleOrDefault(s => s.StudentID == ajaxData.StudentInfo.StudentID); AppRelationsEntity appRelation = repository.AppRelation.SingleOrDefault(a=>a.StudentID == studentInfo.StudentID); studentInfo.EducationIntention = ajaxData.StudentInfo.EducationIntention; studentInfoRepository.SaveStudentTPInfo(studentTPInfo); studentInfoRepository.SaveStudentInfo(studentInfo, appRelation); ExamResultEntity _TFIELTSResult = ajaxData.TFIELTSResult; ExamResultTFIELTSEntity _TFIELTSResultDetail = ajaxData.TFIELTSResultDetail; if ((_TFIELTSResult.ExamType == ExamType.TOFEL || _TFIELTSResult.ExamType == ExamType.IELTS)) { repository.SaveExamResult(_TFIELTSResult); if (_TFIELTSResultDetail.ExamID != _TFIELTSResult.ExamID) { _TFIELTSResultDetail.ExamID = _TFIELTSResult.ExamID = Guid.NewGuid(); } repository.SaveExamResultTFIELTS(_TFIELTSResultDetail); } EducationIntention eduIntention = studentInfo.EducationIntention; switch (eduIntention) { case EducationIntention.高中: { ajaxData.SATSSATResult.ExamType = ExamType.SSAT; SaveSSATResult(ajaxData.SATSSATResult, ajaxData.SATSSATResultDetail); break; } case EducationIntention.本科: { ajaxData.SATSSATResult.ExamType = ExamType.SAT; repository.SaveExamResult(ajaxData.SAT2Result); SaveSATResult(ajaxData.SATSSATResult, ajaxData.SATSSATResultDetail); break; } case EducationIntention.研究生: SaveGreGmatResult(ajaxData.GREGMATResult, ajaxData.GREGMATResultDetail); break; default: break; } return Json(true); }
public JsonResult PostFirstInterviewRegFromForm(FirstInterviewRegModel ajaxData) { if (ajaxData == null || ajaxData.StudentInfo == null) return Json(false); Guid studentID = ajaxData.StudentInfo.StudentID; IEnumerable<StudentFromEntity> studentFromList = ajaxData.StudentFromList; studentInfoRepository.SaveStudentFrom(studentFromList, studentID); return Json(true); }
public JsonResult PostFirstInterviewRegInfoForm(FirstInterviewRegModel ajaxData) { if(ajaxData == null || ajaxData.StudentInfo == null) return Json(false); StudentInfoEntity studentInfo = ajaxData.StudentInfo; studentInfoRepository.SaveStudentInfo(studentInfo, repository.AppRelation.SingleOrDefault(a=>a.StudentID == studentInfo.StudentID)); return Json(true); }
public JsonResult PostFirstInterviewRegFlashPointForm(FirstInterviewRegModel ajaxData) { if (ajaxData == null || ajaxData.StudentInfo == null) return Json(false); Guid studentID = ajaxData.StudentInfo.StudentID; IEnumerable<StudentFlashPointEntity> flashPointList = ajaxData.StudentFlashPointList; repository.SaveStudentFlashPoint(flashPointList, studentID); return Json(true); }