private void PhysicalPersonsDataGrid_OnCellEditEnding(object sender, DataGridCellEditEndingEventArgs e) { if (SelectedPhysicalPersonClient != null) { using (var repo = new PhysicalPersonClientRepository()) { repo.Update(SelectedPhysicalPersonClient); repo.Save(); } } }
private void RemovePhysicalPersonClientButton_OnClick(object sender, RoutedEventArgs e) { using (var repo = new PhysicalPersonClientRepository()) { repo.RemoveClient(SelectedPhysicalPersonClient); repo.Save(); repo.Update(SelectedPhysicalPersonClient); } PhysicalPersonClients.Remove(SelectedPhysicalPersonClient); }