Пример #1
0
        private void ShowAddContactWindowCommandExecuted()
        {
            RaisePropertyChanged("DisableParentWindow");

            var view = new AddContactView();
            view.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");

            if (view.DialogResult != null && view.DialogResult.Value && view.ViewModel.ContactModel != null)
            {
                Contact = view.ViewModel.ContactModel;
            }
        }
Пример #2
0
        private void EditPrimaryContactCommandExecuted()
        {
            RaisePropertyChanged("DisableParentWindow");

            var window = new AddContactView(_event.PrimaryContact);
            window.ShowDialog();

            if (window.DialogResult != null && window.DialogResult == false)
            {
                _event.PrimaryContact = _originalEvent.PrimaryContact.Clone();
            }

            RaisePropertyChanged("EnableParentWindow");
        }
Пример #3
0
        private void EditPrimaryContactCommandExecuted()
        {
            RaisePropertyChanged("DisableParentWindow");

            var window = new AddContactView(_enquiry.PrimaryContact);
            window.ShowDialog();

            if (window.DialogResult != null && window.DialogResult == false)
            {
                //_enquiry.PrimaryContact = _originalEnquiry.PrimaryContact;
                _enquiry.PrimaryContact.Address1 = _originalEnquiry.PrimaryContact.Address1;
                _enquiry.PrimaryContact.Address2 = _originalEnquiry.PrimaryContact.Address2;
                _enquiry.PrimaryContact.Address3 = _originalEnquiry.PrimaryContact.Address3;
                _enquiry.PrimaryContact.City = _originalEnquiry.PrimaryContact.City;
                _enquiry.PrimaryContact.CompanyName = _originalEnquiry.PrimaryContact.CompanyName;
                _enquiry.PrimaryContact.Country = _originalEnquiry.PrimaryContact.Country;
                _enquiry.PrimaryContact.Email = _originalEnquiry.PrimaryContact.Email;
                _enquiry.PrimaryContact.FirstName = _originalEnquiry.PrimaryContact.FirstName;
                _enquiry.PrimaryContact.LastName = _originalEnquiry.PrimaryContact.LastName;
                _enquiry.PrimaryContact.Phone1 = _originalEnquiry.PrimaryContact.Phone1;
                _enquiry.PrimaryContact.Phone2 = _originalEnquiry.PrimaryContact.Phone2;
                _enquiry.PrimaryContact.PostCode = _originalEnquiry.PrimaryContact.PostCode;
                _enquiry.PrimaryContact.Title = _originalEnquiry.PrimaryContact.Title;

            }
            else
            {
                // _enquiry.PrimaryContact = window.ViewModel.ContactModel;
            }

            RaisePropertyChanged("EnableParentWindow");
        }
Пример #4
0
        private void ShowAddContactWindowCommandExecuted()
        {
            RaisePropertyChanged("DisableParentWindow");

            var addContactView = new AddContactView();
            addContactView.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");

            if (addContactView.DialogResult == null || addContactView.DialogResult != true || addContactView.ViewModel.ContactModel == null) return;

            Contact = addContactView.ViewModel.ContactModel;
        }
Пример #5
0
        private void EditContactCommandExecuted(ContactModel model)
        {
            RaisePropertyChanged("DisableParentWindow");

            var window = new AddContactView(model, IsFromMembership);
            window.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");


            if (window.DialogResult != null && window.DialogResult == true)
            {
                if (IsFromMembership)
                    _membershipDataUnit.ContactsRepository.RefreshContact();
                else
                    _contactsDataUnit.ContactsRepository.RefreshContact();
            }
        }
Пример #6
0
        private void AddContactCommandExecuted()
        {
            RaisePropertyChanged("DisableParentWindow");

            var window = new AddContactView(null, IsFromMembership);
            window.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");

            if (window.DialogResult != null && window.DialogResult == true)
            {
                if (!window.ViewModel.IsExistingContact)
                    _allContacts.Add(window.ViewModel.ContactModel);
                Contacts = new ObservableCollection<ContactModel>(_allContacts.OrderBy(x => x.LastName));
                SelectedContact = window.ViewModel.IsExistingContact ? Contacts.FirstOrDefault(contact => contact.Contact == window.ViewModel.ContactModel.Contact) : window.ViewModel.ContactModel;
                RaisePropertyChanged("ScrollToSelectedItem");
            }
        }
        private void EditAlternativeContactCommandExecuted(EventContact obj)
        {
            RaisePropertyChanged("DisableParentWindow");

            var window = new AddContactView(new ContactModel(obj.Contact));
            window.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");
        }