Beispiel #1
0
 public bool AddStudent(string name, int majorId)
 {
     return(data.AddStudent(new Student
     {
         Department = data.FindOrCreateDepartment(majorId),
         Person = new Person
         {
             Name = name
         }
     }));
 }
Beispiel #2
0
        /// <summary>
        /// Convert DepartmentDAO into Department.
        /// </summary>
        /// <param name="departmentDAO">The DepartmentDAO to convert.</param>
        /// <returns>The Department.</returns>
        public static Department MapToDepartment(DepartmentDAO departmentDAO)
        {
            RegistrationData data = new RegistrationData();

            Department department = data.FindOrCreateDepartment(departmentDAO.Id);

            department.DepartmentId = departmentDAO.Id;
            department.Name         = departmentDAO.Name;

            return(department);
        }