Example #1
0
        public void AddPhoneNumber(
            int accountId,
            string phoneNumber,
            Phone.PhoneServiceTypes phoneServiceType,
            Phone.PhoneLocationTypes phoneLocationType,
            int slot,
            string phoneStatusId)
        {
            if (string.IsNullOrEmpty(phoneNumber))
            {
                throw new Exception("Phone number is empty");
            }

            var phone = new Phone
            {
                AccountId     = accountId,
                PhoneNumber   = phoneNumber,
                ServiceType   = phoneServiceType,
                LocationType  = phoneLocationType,
                PhoneSlot     = slot,
                PhoneStatusId = phoneStatusId
            };

            PhoneManager.SavePhone(phone, UserId, PositionId);
            var account = AccountManager.GetAccount(accountId);

            account.Phones.Add(phone);
        }