private void UserShowLog(User selectedUser) { if (selectedUser == null) return; LogForX = Model.Instance.Transactions .Where(t => t.studentId.Equals(selectedUser.UserID)) .Select(t => String.Format("{0} bought {1} x {2}.", selectedUser.Name, t.amount, t.productId)) .ToList(); (new View.ShowLog()).ShowDialog(); }
public AddUserCommand(ObservableCollection<User> users, User user) { _users = users; _user = user; }
private void DeleteSelectedUser(User selectedUser) { if (selectedUser != null) { var response = MessageBox.Show("Do you really want to delete user " + selectedUser.ToString(), "Deleting...", MessageBoxButton.YesNo, MessageBoxImage.Exclamation); if (response == MessageBoxResult.Yes) { OLModel.Helpers.AdminLog("User {0} was deleted.", selectedUser); Model.Instance.Users.Remove(selectedUser); } } }