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

            return(null);
        }
示例#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);
        }
示例#3
0
        public PhoneDTO Update(PhoneDTO oPhoneDTO)
        {
            PhoneDTO returnPhone = null;

            if (oPhoneDTO != null && oPhoneDTO.PhoneID > 0)
            {
                oPhoneRepo.UpdatePhone(PhoneAssembler.ToEntity(oPhoneDTO));
                returnPhone = oPhoneDTO;
            }

            return(returnPhone);
        }
示例#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);
        }