UserData.xaml.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace ModuleExam
  16. {
  17. /// <summary>
  18. /// Логика взаимодействия для UserData.xaml
  19. /// </summary>
  20. public partial class UserData : Page
  21. {
  22. ExamEntities DB = new ExamEntities();
  23. List<users> users;
  24. List<usersmetrics> metrics;
  25. int UserId;
  26. public UserData(int id)
  27. {
  28. InitializeComponent();
  29. users = DB.users.ToList();
  30. SelectUser.ItemsSource = users.Where(x=>x.posts.roles.id != 1).Select(x=>x.surname +" "+ x.firstname + " " + x.patronymic).ToList();
  31. UserId = id;
  32. }
  33. private void ChangeUser(object sender, SelectionChangedEventArgs e)
  34. {
  35. metrics = DB.usersmetrics.Where(x=>x.id_user == SelectUser.SelectedIndex+1).ToList();
  36. UserActivity.ItemsSource = metrics.ToList();
  37. }
  38. private void GoBack(object sender, RoutedEventArgs e)
  39. {
  40. MainFrame.MFrame.Navigate(new ActivityPage(UserId));
  41. }
  42. }
  43. }