public static Enrollment FromDataAccessObject(DataAccess.Enrollment obj)
        {
            if (obj == null)
            {
                return(null);
            }

            Enrollment newObj = new Enrollment();

            ServiceObjects.Enrollment.Copy(obj, newObj);

            return(newObj);
        }
Пример #2
0
        public static Enrollment FromDataAccessObject(DataAccess.Enrollment obj)
        {
            if (obj == null)
            {
                return(null);
            }

            Enrollment newObj = new Enrollment();

            ServiceObjects.Enrollment.Copy(obj, newObj);

            newObj.Links.Add(new Link("Student", LinkType.Student, RESTUrlUtil.Service.RESTSvc.GetStudentByID(newObj.StudentID)));
            newObj.Links.Add(new Link("Course", LinkType.Course, RESTUrlUtil.Service.RESTSvc.GetCourseByID(newObj.CourseID)));

            return(newObj);
        }
 protected static void Copy(DataAccess.Enrollment obj, Enrollment newObj)
 {
     newObj.ID        = obj.ID;
     newObj.StudentID = obj.StudentID;
     newObj.CourseID  = obj.CourseID;
 }