Exemplo n.º 1
0
        private void btnAddPhone_Click(object sender, RoutedEventArgs e)
        {
            PhoneDialog pd = new PhoneDialog {
                phoneTypeComboBox = { SelectedIndex = 0 }
            };

            if (pd.ShowDialog() == true)
            {
                Phone rec = new Phone
                {
                    PhoneNumber = pd.phoneNumberTextBox.Text,
                    PhoneType   = pd.phoneTypeComboBox.SelectedIndex
                };

                _selectedEntries[_current].Phones.Add(rec);
                DB.SaveChanges();

                _selectedPhones     = _selectedEntries[_current].Phones.ToArray();
                _currentPhoneNumber = _selectedPhones.Length - 1;

                Display();
            }
        }
Exemplo n.º 2
0
        private void btnAddPhone_Click(object sender, RoutedEventArgs e)
        {
            PhoneDialog pd = new PhoneDialog {phoneTypeComboBox = {SelectedIndex = 0}};

            if (pd.ShowDialog() == true)
            {
                Phone rec = new Phone
                {
                    PhoneNumber = pd.phoneNumberTextBox.Text,
                    PhoneType = pd.phoneTypeComboBox.SelectedIndex
                };

                _selectedEntries[_current].Phones.Add(rec);
                DB.SaveChanges();

                _selectedPhones = _selectedEntries[_current].Phones.ToArray();
                _currentPhoneNumber = _selectedPhones.Length - 1;

                Display();
            }
        }