Exemplo n.º 1
0
        private void buttonDeleteUser_Click(object sender, RoutedEventArgs e)
        {
            DataRowView dataRow = (DataRowView)dataGridUserList.SelectedItem;

            UserAccDB.DeleteUser(Convert.ToInt32(dataRow.Row.ItemArray[0]));
            UserListReload();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
 private void MainWindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     UserAccDB.DeleteUserAccountTMP();
     Application.Current.Shutdown();
 }