|
@@ -21,10 +21,15 @@ namespace MyWpfApp.Pages
|
|
|
/// </summary>
|
|
|
public partial class PageUserList : Page
|
|
|
{
|
|
|
+ List<UserTable> users = Globals.MyGlobalConnection.UserTable.ToList();
|
|
|
public PageUserList()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
- LB1.ItemsSource = Globals.MyGlobalConnection.UserTable.ToList();
|
|
|
+ LB1.ItemsSource = users;
|
|
|
+ cbRoleFind.ItemsSource = Globals.MyGlobalConnection.Roles.ToList();
|
|
|
+ cbRoleFind.SelectedValuePath = "ID";
|
|
|
+ cbRoleFind.DisplayMemberPath = "Role";
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -44,5 +49,20 @@ namespace MyWpfApp.Pages
|
|
|
{
|
|
|
Globals.MyGlobalFrame.Navigate(new PageUserInfo());
|
|
|
}
|
|
|
+
|
|
|
+ private void txtSurnameFind_TextChanged(object sender, TextChangedEventArgs e)
|
|
|
+ {
|
|
|
+ LB1.ItemsSource = users.Where(x=>x.Surname.StartsWith(txtSurnameFind.Text)).ToList();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void cbRoleFind_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
+ {
|
|
|
+ LB1.ItemsSource = users.Where(x=>x.LoginedTable.IDRole == (int)cbRoleFind.SelectedValue).ToList();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnResetFilters_Click(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ LB1.ItemsSource = users;
|
|
|
+ }
|
|
|
}
|
|
|
}
|