Пример #1
0
        public ContactPhoneModel Create(ContactPhone contactPhone)
        {
            var result = new ContactPhoneModel
            {
                Type = contactPhone.Type,
                PhoneNumber = contactPhone.Number,
                PreMessageDigits =  contactPhone.PreMessageDigits,
                PostMessageDigits = contactPhone.PostMessageDigits
            };

            return result;
        }
Пример #2
0
        public ContactPhone Parse(ContactPhoneModel model)
        {
            try
            {
                var contactPhone = new ContactPhone();

                contactPhone.Type = model.Type;
                contactPhone.Number = model.PhoneNumber;
                contactPhone.PreMessageDigits = model.PreMessageDigits;
                contactPhone.PostMessageDigits = model.PostMessageDigits;

                return contactPhone;
            }
            catch (Exception)
            {
                return null;
            }
        }
Пример #3
0
        public ContactPhone Parse(ContactPhoneModel model)
        {
            try
            {
                var user = new ContactPhone
                {
                    Type = model.Type,
                    Number = model.PhoneNumber
                };

                ////Below code is an example of how to get ID for url's pass in to the model
                //var uri = new Uri(model.URL);
                //var notificationId = int.Parse(uri.Segments.Last());

                return user;
            }
            catch (Exception)
            {
                return null;
            }
        }
Пример #4
0
        public ContactPhoneModel Create(ContactPhone contactPhone)
        {
            var result = new ContactPhoneModel
            {
                Type = contactPhone.Type,
                PhoneNumber = contactPhone.Number,
                ContactId = contactPhone.ContactId
            };

            return result;
        }