private void buttonDeleteUser_Click(object sender, RoutedEventArgs e) { DataRowView dataRow = (DataRowView)dataGridUserList.SelectedItem; UserAccDB.DeleteUser(Convert.ToInt32(dataRow.Row.ItemArray[0])); UserListReload(); }
private void PinNumberChanged(object sender, TextChangedEventArgs e) { IsValidUser = false; string tempPin = UserAccDB.GetExistingPinCodeFromDB(passwordTextBox.Text); if (tempPin == Encryption.ComputeSha256Hash(passwordTextBox.Text)) { IsValidUser = true; UserAccDB.CreateUserLoginTMP(passwordTextBox.Text); this.Close(); } DisplayPinNumber(); }
private void buttonCheck_Click(object sender, RoutedEventArgs e) { if (textBoxFirstName.Text != "" && textBoxLastName.Text != "" && (passwordBoxConfirmPinCode.Password == passwordBoxPinCode.Password)) { if (!(UserAccDB.DuplicatePinCode(passwordBoxPinCode.Password))) { UserAccDB.AddNewUser(textBoxFirstName.Text, textBoxLastName.Text, passwordBoxPinCode.Password); ClosingSequence(); } else { MessageBox.Show("The pincode is already used. Please use another unique pincode", "PinCode already used", MessageBoxButton.OK, MessageBoxImage.Error); } } else { MessageBox.Show("Please verify the information marked as red", "Incorrect Information", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void MainWindowClosing(object sender, System.ComponentModel.CancelEventArgs e) { UserAccDB.DeleteUserAccountTMP(); Application.Current.Shutdown(); }