Esempio n. 1
0
 //Controller
 private void Login(string email, string password)
 {
     foreach (Models.User user in database.users)
     {
         if (email.ToLower() == user.Email.ToLower() && password == user.Password)
         {
             currUser             = user;
             MainMenu.Visible     = true;
             SearchBar.Visible    = true;
             SearchButton.Visible = true;
             SearchButton.BringToFront();
             SearchBar.BringToFront();
             ProfileMenuItem_Click(null, null);
             return;
         }
     }
     if (database.users.Count == 0)
     {
         throw new ArgumentNullException("No users in database");
     }
     else
     {
         LoginWrong.Visible = true;
         LoginEmalBox.Clear();
         LoginPasswordBox.Clear();
     }
 }
Esempio n. 2
0
 private void LogOut_Click(object sender, EventArgs e)
 {
     ChangeTab(LoginPage, null);
     MainMenu.Visible     = false;
     SearchBar.Visible    = false;
     SearchButton.Visible = false;
     LoginWrong.Visible   = false;
     LoginEmalBox.Clear();
     LoginPasswordBox.Clear();
 }
Esempio n. 3
0
        private void DialogHost_DialogClosing(object sender, MaterialDesignThemes.Wpf.DialogClosingEventArgs eventArgs)
        {
            string loginPassword = LoginPasswordBox.Password;
            LoginPasswordBox.Clear();
            if (!Equals(eventArgs.Parameter, true)) return;

            if (!string.IsNullOrWhiteSpace(loginPassword))
            {
                if (leakTestDataSetUsersTableAdapter.IsPasswordRight(user.UserName, loginPassword) >0)
                {
                    MainWindow.publicProperties.CurrentUser = user;
                    IsDeleteButtonEnable = false;
                    IsEditButtonEnable = false;
                }
            }
        }
Esempio n. 4
0
        private void TransitionerBackToUser_OnClick(object sender, RoutedEventArgs e)
        {
            if (LoginTransitioner.SelectedIndex != 0)
            {
                LoginTransitioner.SelectedIndex = 0;
            }

            PasswordBox.Clear();
            ShowPasswordBox.Clear();
            LoginPasswordBox.Clear();
            ShowLoginPasswordBox.Clear();
            ConfirmPasswordBox.Clear();
            ShowConfirmPasswordBox.Clear();
            MonobankApiKey.Clear();
            ForgotPasswordCheckMonobankApiKey.Clear();

            Transitioner.SelectedIndex = 1;
        }