/// <summary>
 /// create a new enrollment
 /// </summary>
 /// <param name="s"></param>
 public static void CreateEnrollment(string student_id, int schedule_id)
 {
     SLEnrollment.ISLEnrollment SLEnrollment = new SLEnrollment.SLEnrollmentClient();
     string[] errors = new string[0];
     SLEnrollment.InsertEnrollmentRequest request = new SLEnrollment.InsertEnrollmentRequest(student_id, schedule_id, errors);
     SLEnrollment.InsertEnrollment(request);
 }
 /// <summary>
 /// update existing enrollment info
 /// </summary>
 /// <param name="s"></param>
 public static void UpdateEnrollment(string student_id, int schedule_id, string grade)
 {
     SLEnrollment.ISLEnrollment SLEnrollment = new SLEnrollment.SLEnrollmentClient();
     string[] errors = new string[0];
     SLEnrollment.UpdateEnrollmentRequest request = new SLEnrollment.UpdateEnrollmentRequest(student_id, schedule_id, grade, errors);
     SLEnrollment.UpdateEnrollment(request);
 }
        /// <summary>
        /// call service layer's delete enrollment method
        /// </summary>
        /// <param name="id"></param>
        public static bool DeleteEnrollment(string student_id, int schedule_id)
        {
            SLEnrollment.ISLEnrollment SLEnrollment = new SLEnrollment.SLEnrollmentClient();
            string[] errors = new string[0];
            SLEnrollment.DeleteEnrollmentRequest  request  = new SLEnrollment.DeleteEnrollmentRequest(student_id, schedule_id, errors);
            SLEnrollment.DeleteEnrollmentResponse response = SLEnrollment.DeleteEnrollment(request);
            if (response.errors.Length > 0)
            {
                return(false);
            }

            return(true);
        }
        public static List <PLEnrollment> GetEnrollmentList()
        {
            List <PLEnrollment> enrollmentList = new List <PLEnrollment>();

            SLEnrollment.ISLEnrollment client = new SLEnrollment.SLEnrollmentClient();

            string[] errors = new string[0];
            SLEnrollment.GetEnrollmentListRequest  request  = new SLEnrollment.GetEnrollmentListRequest(errors);
            SLEnrollment.GetEnrollmentListResponse response = client.GetEnrollmentList(request);
            SLEnrollment.Enrollment[] enrollmentsLoaded     = response.GetEnrollmentListResult;
            if (enrollmentsLoaded != null)
            {
                foreach (SLEnrollment.Enrollment s in enrollmentsLoaded)
                {
                    PLEnrollment enrollment = DTO_to_PL(s);
                    enrollmentList.Add(enrollment);
                }
            }

            return(enrollmentList);
        }