|
@@ -21,15 +21,11 @@ namespace MyWpfApp.Pages
|
|
/// </summary>
|
|
/// </summary>
|
|
public partial class PageUserList : Page
|
|
public partial class PageUserList : Page
|
|
{
|
|
{
|
|
- List<UserTable> users = Globals.MyGlobalConnection.UserTable.ToList();
|
|
|
|
|
|
+ UserListModel users = new UserListModel();
|
|
public PageUserList()
|
|
public PageUserList()
|
|
{
|
|
{
|
|
- InitializeComponent();
|
|
|
|
- LB1.ItemsSource = users;
|
|
|
|
- cbRoleFind.ItemsSource = Globals.MyGlobalConnection.Roles.ToList();
|
|
|
|
- cbRoleFind.SelectedValuePath = "ID";
|
|
|
|
- cbRoleFind.DisplayMemberPath = "Role";
|
|
|
|
-
|
|
|
|
|
|
+ InitializeComponent();
|
|
|
|
+ DataContext = users;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -50,19 +46,13 @@ namespace MyWpfApp.Pages
|
|
Globals.MyGlobalFrame.Navigate(new PageUserInfo());
|
|
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)
|
|
private void btnResetFilters_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|
|
- LB1.ItemsSource = users;
|
|
|
|
|
|
+ users.Surname = null;
|
|
|
|
+ users.IdRole = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|