示例#1
0
 private void BTLogin_Click(object sender, RoutedEventArgs e)
 {
     //filling list
     user = Methods.fillUser();
     //checking if they entered something
     if (TBUserName.Text.Length == 0 || TBUserName.Text == "UserName")
     {
         //printing from dll that there no username entered
         LbErrorUser.Visibility = Visibility.Visible;
     }
     else
     {
         //checking if they entered something
         if (TBPassWord.Text.Length == 0 || TBPassWord.Text == "PassWord")
         {
             //printing from dll that there no Password entered
             LbErrorPass.Visibility = Visibility.Visible;
         }
         else
         {  //looping throuch the list that contakes info form login table and checking if valid user
             foreach (UserInfo u in user)
             {
                 //checking username and password
                 if (TBUserName.Text == u.UserName && TBPassWord.Text == u.PassWord)
                 {
                     //change to diffrent screen if right.
                     beggining.displayUserView(TBUserName.Text);
                     PersonID = u.id;
                     this.Hide();
                 }
             }
         }
     }
 }
示例#2
0
 private void BTLogin_Click(object sender, RoutedEventArgs e)
 {
     user = Methods.fillUser();
     foreach (UserInfo u in user)
     {
         if (TBUserName.Text == u.UserName)
         {
             beggining.displayUserView(TBUserName.Text);
             this.Hide();
         }
     }
 }