Beispiel #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();
     }
 }
Beispiel #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();
 }