public ActionResult <ScheduledStudentDropModel> DropScheduledCourseSectionForStudent360(ScheduledStudentDropModel scheduledStudentDropModel) { ScheduledStudentDropModel ScheduledStudentDrop = new ScheduledStudentDropModel(); try { ScheduledStudentDrop = _studentScheduleService.DropScheduledCourseSectionForStudent360(scheduledStudentDropModel); } catch (Exception es) { ScheduledStudentDrop._failure = true; ScheduledStudentDrop._message = es.Message; } return(ScheduledStudentDrop); }
public ActionResult <ScheduledStudentDropModel> GroupDropForScheduledStudent(ScheduledStudentDropModel scheduledStudentDropModel) { ScheduledStudentDropModel ScheduledStudentDrop = new ScheduledStudentDropModel(); try { ScheduledStudentDrop = _studentScheduleService.GroupDropForScheduledStudent(scheduledStudentDropModel); } catch (Exception es) { ScheduledStudentDrop._failure = true; ScheduledStudentDrop._message = es.Message; } return(ScheduledStudentDrop); }
/// <summary> /// Group Drop For Scheduled Student /// </summary> /// <param name="scheduledStudentDropModel"></param> /// <returns></returns> public ScheduledStudentDropModel GroupDropForScheduledStudent(ScheduledStudentDropModel scheduledStudentDropModel) { try { var currentDate = DateTime.UtcNow.Date; if (scheduledStudentDropModel.studentCoursesectionScheduleList.Count > 0) { if (scheduledStudentDropModel.EffectiveDropDate.Value.Date >= currentDate) { foreach (var scheduledStudent in scheduledStudentDropModel.studentCoursesectionScheduleList) { var studentData = this.context?.StudentCoursesectionSchedule.FirstOrDefault(x => x.SchoolId == scheduledStudent.SchoolId && x.TenantId == scheduledStudent.TenantId && x.StudentId == scheduledStudent.StudentId && x.CourseSectionId == scheduledStudentDropModel.CourseSectionId); if (studentData != null) { studentData.IsDropped = true; studentData.EffectiveDropDate = scheduledStudentDropModel.EffectiveDropDate; this.context?.UpdateRange(studentData); } else { scheduledStudentDropModel._message = NORECORDFOUND; scheduledStudentDropModel._failure = true; } } this.context?.SaveChanges(); scheduledStudentDropModel._failure = false; scheduledStudentDropModel._message = "Selected students have been dropped from the course section."; } else { scheduledStudentDropModel._message = "Effective Drop Date Must Be Equal or Greater Than Current Date"; scheduledStudentDropModel._failure = true; } } else { scheduledStudentDropModel._message = "Select Atleast One Student"; scheduledStudentDropModel._failure = true; } } catch (Exception es) { scheduledStudentDropModel._failure = true; scheduledStudentDropModel._message = es.Message; } return(scheduledStudentDropModel); }
public ScheduledStudentDropModel GroupDropForScheduledStudent(ScheduledStudentDropModel scheduledStudentDropModel) { ScheduledStudentDropModel ScheduledStudentDrop = new ScheduledStudentDropModel(); try { if (TokenManager.CheckToken(scheduledStudentDropModel._tenantName + scheduledStudentDropModel._userName, scheduledStudentDropModel._token)) { ScheduledStudentDrop = this.studentScheduleRepository.GroupDropForScheduledStudent(scheduledStudentDropModel); } else { ScheduledStudentDrop._failure = true; ScheduledStudentDrop._message = TOKENINVALID; } } catch (Exception es) { ScheduledStudentDrop._failure = true; ScheduledStudentDrop._message = es.Message; } return(ScheduledStudentDrop); }