private void DeleteExecute(object obj) { if (m_deleteConfirmationViewService.Show("account relationship")) { // Update model m_accountRelationshipService.Delete(SelectedAccountRelationship.AccountRelationshipId); // Update view model AccountRelationships.Remove(SelectedAccountRelationship); } }
private void EditExecute(object obj) { AccountRelationship updatedRelationship; if (m_accountRelationshipEditViewService.Show( SelectedAccountRelationship.AccountRelationshipId, out updatedRelationship)) { AccountRelationships.Remove(SelectedAccountRelationship); SelectedAccountRelationship = m_accountRelationshipItemViewModelFactory.Create(updatedRelationship); AccountRelationships.Add(SelectedAccountRelationship); } }
private void CreateExecute(object obj) { AccountRelationship hint = null; IAccountRelationshipItemViewModel hintViewModel = AccountRelationships.FirstOrDefault(); if (AccountRelationships.Any()) { hint = m_accountRelationshipService.Get(AccountRelationships.First().AccountRelationshipId); } AccountRelationship newRelationship; if (m_accountRelationshipCreateViewService.Show(hint, out newRelationship)) { IAccountRelationshipItemViewModel viewModel = m_accountRelationshipItemViewModelFactory.Create(newRelationship); AccountRelationships.Add(viewModel); } }