Beispiel #1
0
 private void capturePersonPhone(TextEdit txtPersonPhone, ComboBoxEdit cmbPhoneType, ICollection<PersonPhoneDto> personPhones)
 {
     var personPhone = txtPersonPhone.Tag as PersonPhoneDto;
     if (txtPersonPhone.Text != null)
     {
         if (personPhone == null)
         {
             personPhone = new PersonPhoneDto();
         }
         personPhone.Phone = txtPersonPhone.Text;
         var phoneType = cmbPhoneType.SelectedItem as PhoneTypeDto;
         personPhone.PhoneTypeId = phoneType.Id;
         personPhones.Add(personPhone);
     }
 }
Beispiel #2
0
        private void FixupPersonPhone(PersonPhoneDto previousValue)
        {
            if (previousValue != null && previousValue.BudgetRequests.Contains(this))
            {
                previousValue.BudgetRequests.Remove(this);
            }

            if (PersonPhone != null)
            {
                if (!PersonPhone.BudgetRequests.Contains(this))
                {
                    PersonPhone.BudgetRequests.Add(this);
                }
                if (PersonPhoneId != PersonPhone.Id)
                {
                    PersonPhoneId = PersonPhone.Id;
                }
            }
        }