Beispiel #1
0
        public void AddStudent(BO.Student student)
        {
            //Add new student  (DO.Person + DO.Student)
            //with no courses (courses will be added one by one through AddStudentInCourse()

            //Add DO.Person
            DO.Person personDO = new DO.Person();
            student.CopyPropertiesTo(personDO);
            try
            {
                dl.AddPerson(personDO);
            }
            catch (DO.BadPersonIdException ex)
            {
                throw new BO.BadStudentIdException("Student ID is illegal", ex);
            }

            //Add DO.Student
            DO.Student studentDO = new DO.Student();
            student.CopyPropertiesTo(studentDO);
            try
            {
                dl.AddStudent(studentDO);
            }
            catch (DO.BadPersonIdException ex)
            {
                throw new BO.BadStudentIdException("Student ID is illegal", ex);
            }
        }
Beispiel #2
0
        public void UpdateStudentPersonalDetails(BO.Student student)
        {
            //Update DO.Person
            DO.Person personDO = new DO.Person();
            student.CopyPropertiesTo(personDO);
            try
            {
                dl.UpdatePerson(personDO);
            }
            catch (DO.BadPersonIdException ex)
            {
                throw new BO.BadStudentIdException("Student ID is illegal", ex);
            }

            //Update DO.Student
            DO.Student studentDO = new DO.Student();
            student.CopyPropertiesTo(studentDO);
            try
            {
                dl.UpdateStudent(studentDO);
            }
            catch (DO.BadPersonIdException ex)
            {
                throw new BO.BadStudentIdException("Student ID is illegal", ex);
            }
        }
 public static BO.PersonBO ConverFrom_DO_To_BoPerson(DO.Person other)
 {
     BO.PersonBO copy = new BO.PersonBO();
     copy.Id        = other.Id;
     copy.Email     = other.Email;
     copy.FirstName = other.FirstName;
     copy.LastName  = other.LastName;
     copy.IdType    = (BO.IdType)other.IdType;
     copy.Password  = other.Password;
     copy.Phone     = other.Phone;
     copy.Status    = (BO.StatusPerson)other.Status;
     return(copy);
 }
 public static DO.Person ConverFrom_BO_To_DoPerson(BO.PersonBO other)
 {
     DO.Person copy = new DO.Person();
     copy.Id        = other.Id;
     copy.Email     = other.Email;
     copy.FirstName = other.FirstName;
     copy.LastName  = other.LastName;
     copy.IdType    = (DO.IdType)other.IdType;
     copy.Password  = other.Password;
     copy.Phone     = other.Phone;
     copy.Status    = (DO.StatusPerson)other.Status;
     return(copy);
 }
 public static DO.Person Conv_BO_To_DO(BO.Person item)
 {
     DO.Person temp = new DO.Person();
     temp.Id        = item.Id;
     temp.Email     = item.Email;
     temp.FirstName = item.FirstName;
     temp.LastName  = item.LastName;
     temp.IdType    = (DO.IdType)item.IdType;
     temp.Password  = item.Password;
     temp.Phone     = item.Phone;
     temp.Status    = (DO.PersonStatus)item.Status;
     temp.Address   = item.Address;
     return(temp);
 }
Beispiel #6
0
 public static DO.Person CastingToDOPerson(BO.Person bPerson)
 {
     DO.Person person = new DO.Person();
     person.Id          = bPerson.Id;
     person.IdType      = (DO.ID)bPerson.IdType;
     person.Status      = (DO.Status)bPerson.Status;
     person.Password    = bPerson.Password;
     person.FirstName   = bPerson.FirstName;
     person.LastName    = bPerson.LastName;
     person.PhoneNumber = bPerson.PhoneNumber;
     person.MailAddress = bPerson.MailAddress;
     person.UserType    = bPerson.UserType;
     return(person);
 }
Beispiel #7
0
 public static BO.Person CastingToBOPerson(DO.Person person)
 {
     BO.Person bPerson = new BO.Person();
     bPerson.Id          = person.Id;
     bPerson.IdType      = (BO.ID)person.IdType;
     bPerson.Status      = (BO.Status)person.Status;
     bPerson.Password    = person.Password;
     bPerson.FirstName   = person.FirstName;
     bPerson.LastName    = person.LastName;
     bPerson.PhoneNumber = person.PhoneNumber;
     bPerson.MailAddress = person.MailAddress;
     bPerson.UserType    = person.UserType;
     return(bPerson);
 }