Esempio n. 1
0
        public AddressDTO Get(int AddressID)
        {
            AddressDTO oAddressDTO = null;

            if (AddressID > 0)
            {
                Address oAddress = oAddressRepo.GetAddressByID(AddressID);
                if (oAddress != null)
                {
                    oAddressDTO = AddressAssembler.ToDTO(oAddress);
                    if (oAddress.Country != null)
                    {
                        oAddressDTO.Country = CountryAssembler.ToDTO(oAddress.Country);
                    }
                    if (oAddress.TypeCode != null)
                    {
                        oAddressDTO.TypeCode = TypeCodeAssembler.ToDTO(oAddress.TypeCode);
                    }
                    if (oAddress.TypeCode != null && oAddress.TypeCode.ClassType != null)
                    {
                        oAddressDTO.TypeCode.ClassType = ClassTypeAssembler.ToDTO(oAddress.TypeCode.ClassType);
                    }
                }
            }

            return(oAddressDTO);
        }
Esempio n. 2
0
        public ClassTypeDTO Create(ClassTypeDTO modeDTO)
        {
            if (modeDTO != null)
            {
                return(ClassTypeAssembler.ToDTO(classTypeRepos.CreateClassType(ClassTypeAssembler.ToEntity(modeDTO))));
            }

            return(null);
        }
Esempio n. 3
0
        public EmailDTO Get(int EmailID)
        {
            EmailDTO oEmailDTO = null;

            if (EmailID > 0)
            {
                Email oEmail = oEmailRepo.GetEmailByID(EmailID);
                if (oEmail != null)
                {
                    oEmailDTO = EmailAssembler.ToDTO(oEmail);
                    if (oEmail.TypeCode != null)
                    {
                        oEmailDTO.TypeCode = TypeCodeAssembler.ToDTO(oEmail.TypeCode);
                    }
                    if (oEmail.TypeCode != null && oEmail.TypeCode.ClassType != null)
                    {
                        oEmailDTO.TypeCode.ClassType = ClassTypeAssembler.ToDTO(oEmail.TypeCode.ClassType);
                    }
                }
            }

            return(oEmailDTO);
        }
Esempio n. 4
0
        public PhoneDTO Get(int PhoneID)
        {
            PhoneDTO oPhoneDTO = null;

            if (PhoneID > 0)
            {
                Phone oPhone = oPhoneRepo.GetPhoneByID(PhoneID);
                if (oPhone != null)
                {
                    oPhoneDTO = PhoneAssembler.ToDTO(oPhone);
                    if (oPhone.TypeCode != null)
                    {
                        oPhoneDTO.TypeCode = TypeCodeAssembler.ToDTO(oPhone.TypeCode);
                    }
                    if (oPhone.TypeCode != null && oPhone.TypeCode.ClassType != null)
                    {
                        oPhoneDTO.TypeCode.ClassType = ClassTypeAssembler.ToDTO(oPhone.TypeCode.ClassType);
                    }
                }
            }

            return(oPhoneDTO);
        }
Esempio n. 5
0
        public EmailDTO Get(int id)
        {
            EmailDTO emailDTO = null;

            if (id > 0)
            {
                Email oEmail = emailRepo.GetEmailByID(id);
                if (oEmail != null)
                {
                    emailDTO = EmailAssembler.ToDTO(oEmail);
                    if (oEmail.TypeCode != null)
                    {
                        emailDTO.TypeCode = TypeCodeAssembler.ToDTO(oEmail.TypeCode);
                    }
                    if (oEmail.TypeCode != null && oEmail.TypeCode.ClassType != null)
                    {
                        emailDTO.TypeCode.ClassType = ClassTypeAssembler.ToDTO(oEmail.TypeCode.ClassType);
                    }
                }
            }

            return(emailDTO);
        }