Exemple #1
0
 //Fyller i TB's med en användare man valt att uppdatera ur Listan
 private void listBoxUsers_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     tbUserID.IsEnabled = true;
     tbUsername.IsEnabled = true;
     tbBoss.IsEnabled = true;
     var logic =  new LogicHandler();
     var selected = listBoxUsers.SelectedValue.ToString();
     var u = logic.getInfoOnSelectedUser();
 
     var val = logic.checkIfDigits(selected);
 
 
     foreach (var user in u.Where(user => val.Equals(user.UID)))
     {
         tbFirstName.Text = user.FirstName;
         tbLastNamne.Text = user.LastName;
         tbEmail.Text = user.Email;
         tbPassword.Text = user.PW;
         tbUsername.Text = user.Username;
         tbSsn.Text = user.SSN;
         tbBoss.Text = user.BID.ToString();
         tbUserID.Text = user.UID.ToString();
     }
 
 }