private void btnPasswordReset_Click(object sender, RoutedEventArgs e) { try { string str = Interaction.InputBox("Enter user id to reset", "", "", -1, -1); if (str == "") { return; } int tmp; if (!int.TryParse(str, out tmp)) { MessageBox.Show("Invalid ID"); return; } user = queries.GetUser(tmp); if (user == null) { MessageBox.Show("Unable To Find User"); return; } queries.ResetUserLogin(user); MessageBox.Show("Password has been reset"); Close(); } catch (Exception exception) { MessageBox.Show(exception.Message); } }