public void DeleteTransactionUser() { if (SelectedTransactionUser != null) { OtherUsers.Add(SelectedTransactionUser.User); db.TransactionUsers.Remove(SelectedTransactionUser); TransactionUsersCollection.Remove(SelectedTransactionUser); SelectedUser = OtherUsers.FirstOrDefault(); } }
public void AddTransactionUser() { if (SelectedUser != null) { var thisTu = TransactionUsersCollection.First(); var tu = db.TransactionUsers.Create(); tu.Transaction = thisTu.Transaction; tu.User = SelectedUser; db.TransactionUsers.Add(tu); TransactionUsersCollection.Add(tu); OtherUsers.Remove(SelectedUser); SelectedUser = OtherUsers.FirstOrDefault(); } }