Beispiel #1
0
 /// <summary>
 /// Logins the specified user.
 /// </summary>
 /// <param name="user">The user.</param>
 /// <returns>Returns true if the user provided the correct password, false if not.</returns>
 public bool Login(User user)
 {
     var crudUser = UserCrud.Read(user);
     if (crudUser != null)
     {
         crudUser.Password.Equals(user.Password);
         return true;
     }
     return false;
 }
Beispiel #2
0
 private void loginButton_Click(object sender, RoutedEventArgs e)
 {
     User user = new User(usernameTextbox.Text, passwordTextbox.Password);
     if (handler.Login(user))
     {
         //Open window
     }
     else
     {
         failTextBlock.Text = "Username or Password is not correct.";
     }
 }
Beispiel #3
0
 private void loginButton_Click(object sender, RoutedEventArgs e)
 {
     User user = new User(usernameTextbox.Text, passwordTextbox.Password);
     if (handler.Login(user))
     {
         new MainWindow().Show();
         this.Close();
     }
     else
     {
         failTextBlock.Text = "Username or Password is not correct.";
     }
 }
Beispiel #4
0
 public override void Update(User entry)
 {
 }
Beispiel #5
0
 public override User Read(User key)
 {
     return users.FirstOrDefault(user => user.Username.Equals(key.Username) && user.Password.Equals(key.Password));
 }
Beispiel #6
0
 public override void Delete(User entry)
 {
 }
Beispiel #7
0
 public override void Create(User entry)
 {
 }