Exemplo n.º 1
0
        /// <summary>
        /// Delete profile phone
        /// </summary>
        /// <param name="profilePhone"></param>
        public void DeleteProfilePhone(ProfilePhone profilePhone)
        {
            Phone phone = _phoneRepository.Get(profilePhone.PhoneId);

            if (phone != null)
            {
                _profilePhoneRepository.Remove(profilePhone);
                _profilePhoneRepository.UnitOfWork.Commit();

                _phoneRepository.Remove(phone);
                _phoneRepository.UnitOfWork.Commit();
            }
            else
            {
                LoggerFactory.CreateLog().LogWarning(Messages.warning_CannotRemoveNonExistingPhone);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Delete profile phone
        /// </summary>
        /// <param name="profilePhone"></param>
        public void DeleteProfilePhone(ProfilePhone profilePhone)
        {
            var phone = _phoneRepository.Get(profilePhone.PhoneId);

            if (phone != null) //if phone exist
            {
                _profilePhoneRepository.Remove(profilePhone);
                //commit changes
                _profilePhoneRepository.UnitOfWork.Commit();

                _phoneRepository.Remove(phone);
                //commit changes
                _phoneRepository.UnitOfWork.Commit();
            }
            else //the customer not exist, cannot remove
            {
                LoggerFactory.CreateLog().LogWarning(Messages.warning_CannotRemoveNonExistingProfile);
            }
        }