Example #1
0
        public PhoneDTO Create(PhoneDTO oPhoneDTO)
        {
            if (oPhoneDTO != null)
            {
                return(PhoneAssembler.ToDTO(oPhoneRepo.CreatePhone(PhoneAssembler.ToEntity(oPhoneDTO))));
            }

            return(null);
        }
Example #2
0
        public PhoneDTO Update(PhoneDTO modelDTO)
        {
            PhoneDTO returnPhone = null;

            if (modelDTO != null && modelDTO.PhoneID > 0)
            {
                returnPhone = PhoneAssembler.ToDTO(phoneRepo.UpdatePhone(PhoneAssembler.ToEntity(modelDTO)));
            }

            return(returnPhone);
        }
Example #3
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);
        }