/// <summary> /// 取得名冊報表 /// </summary> /// <returns></returns> public object GetReport() { IReportBuilder rptBuild = null; switch (_BRec.UpdateType) { case "新生名冊": rptBuild = new EnrollmentList(); break; case "畢業名冊": rptBuild = new GraduateList(); break; case "轉學生入學名冊": rptBuild = new TransferImport1List(); break; case "復學生名冊": rptBuild = new TransferImport2List(); break; case "轉出學生名冊": rptBuild = new TransferExportList(); break; case "延修學生名冊": rptBuild = new ExtendingStudentList(); break; } return(rptBuild); }
/// <summary> /// 取得名冊報表 /// </summary> /// <returns></returns> public object GetReport() { IReportBuilder rptBuild = null; switch (_BRec.UpdateType) { case "新生名冊": rptBuild = new EnrollmentList(); break; case "延修生學籍異動名冊": rptBuild = new ExtendingStudentUpdateRecordList(); break; case "學籍異動名冊": rptBuild = new StudentUpdateRecordList(); break; case "畢業名冊": rptBuild = new GraduatingStudentList(); break; case "延修生畢業名冊": rptBuild = new ExtendingStudentGraduateList(); break; case "延修生名冊": rptBuild = new ExtendingStudentList(); break; case "轉入學生名冊": rptBuild = new TransferringStudentUpdateRecordList(); break; case "新生保留錄取資格名冊": rptBuild = new RetaintoStudentList(); break; case "借讀學生名冊": rptBuild = new TemporaryStudentList(); break; } return(rptBuild); }
public IActionResult Manage(EnrollmentList list) { Course course = courseDB.Courses.FirstOrDefault(c => c.CourseId == list.CourseID); if (course != null) { if (ModelState.IsValid) { foreach (long i in list.EnrollQueue) { Student student = studentDB.Students.FirstOrDefault(s => s.StudentNumber == i); if (!course.Students.Contains(student)) { CourseStudent csdb = course.AddStudent(student); studentDB.SaveStudent(student); csDB.AddCourseStudents(csdb); } } foreach (long i in list.UnEnrollQueue) { Student student = studentDB.Students.FirstOrDefault(s => s.StudentNumber == i); if (course.Students.Contains(student)) { CourseStudent csdb = course.DeleteStudent(student); studentDB.SaveStudent(student); csDB.DeleteCourseStudents(csdb); } } courseDB.SaveCourse(course); TempData["successMessage"] = $"Enrollment changes successfully saved."; return(RedirectToAction(nameof(List))); } else { EnrollmentInfo enrollInfo = CreateEnrollInfo(course); return(View("Enrollment", enrollInfo)); } } else { TempData["errorMessage"] = "Please select a valid course to manage enrollment."; return(RedirectToAction(nameof(List))); } }
public IActionResult Manage(EnrollmentList list) { Course course = courseDB.Courses.FirstOrDefault(c => c.CourseId == list.CourseID); if (course != null) { if (ModelState.IsValid) { if (list.EnrollQueue == null) { TempData["errorMessage"] = "Please select a valid student."; EnrollmentInfo enrollInfo = CreateEnrollInfo(course); return(View("User", enrollInfo)); } foreach (long i in list.EnrollQueue) { Student student = studentDB.Students.FirstOrDefault(s => s.StudentNumber == i); CourseStudent csdb = course.AddStudent(student); studentDB.SaveStudent(student); csDB.AddCourseStudents(csdb); } courseDB.SaveCourse(course); TempData["successMessage"] = $"Student(s) successfully added to the course {course.Name}"; return(RedirectToAction(nameof(Display))); } else { EnrollmentInfo enrollInfo = CreateEnrollInfo(course); return(View("User", enrollInfo)); } } else { TempData["errorMessage"] = "Please select a valid course!"; return(RedirectToAction(nameof(Display))); } }
public async void ConfirmEnrollment(Object o) { string[] succesList = new string[SelectedEnrollment.ParentList.Count]; int i = 0; bool success = await BusinessLogic.Instance.CreateStudent(SelectedEnrollment.ChildFirstname, SelectedEnrollment.ChildLastname, SelectedEnrollment.ChildCity, SelectedEnrollment.ChildAddress, SelectedEnrollment.ChildBirthdate, SelectedEnrollment.ChildPhonenumber, "empty", SelectedClass.Id, SelectedEnrollment); if (success) { foreach (ParentEx parent in SelectedEnrollment.ParentList) { succesList[i] = BusinessLogic.Instance.SendEmail(parent.Email, "Indmeldelse bekræftiget!", "Hej, " + parent.Firstname + "!/nDit barn " + SelectedEnrollment.ChildFirstname + " " + SelectedEnrollment.ChildLastname + "er blevet oprettet " + "i vores system og er tilføjet klassen " + SelectedClass.Name + " med klasselæren " + SelectedClass.AssociatedTeacher + " vi glæder os til at se dig!/nVenlig hilsen Birkealle.");// egentligt ret kritisk, men da vores losning nok ikke er optimal ser vi bort fra at lave en aktiv/passiv paa enrollment. Hvis email fejler kan vi ikke finde frem til indmeldelsen. if (succesList[i] != "Succes") { MessageBox.Show("Noget gik galt under transmission af email til forældren " + parent.Firstname + ". Ring venligst til forældren og fortæl af barnet er oprettet i systemet!/nNummeret er:" + parent.Phonenumber); } i++; } EnrollmentList.Remove(SelectedEnrollment); SelectedEnrollment = null; SelectedClass = null; } else { MessageBox.Show("Kunne ikke oprette indmeldelse! Kontakt support."); } if (succesList.All(obj => obj == "Succes")) { MessageBox.Show("Indmeldelse bekræftiget!"); } }