Tabl.xaml.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 Penis
  16. {
  17. /// <summary>
  18. /// Логика взаимодействия для Tabl.xaml
  19. /// </summary>
  20. public partial class Tabl : Page
  21. {
  22. public Tabl()
  23. {
  24. InitializeComponent();
  25. Entities entities = new Entities();
  26. Reks.ItemsSource = entities.Client.ToList();
  27. }
  28. public void Nazad1(object sender, RoutedEventArgs e)
  29. {
  30. MainFrame.Name1.Navigate(new PageAdmin());
  31. }
  32. public void AZ(object sender, RoutedEventArgs e)
  33. {
  34. Entities entities = new Entities();
  35. Reks.ItemsSource = entities.Client.OrderBy(x => x.Surname).ToList();
  36. }
  37. public void ZA(object sender, RoutedEventArgs e)
  38. {
  39. Entities entities = new Entities();
  40. Reks.ItemsSource = entities.Client.OrderByDescending (x => x.Surname).ToList();
  41. }
  42. public void Men(object sender, RoutedEventArgs e)
  43. {
  44. Entities entities = new Entities();
  45. Reks.ItemsSource = entities.Client.Where(x => x.id_Gender==1).ToList();
  46. }
  47. public void Gerl(object sender, RoutedEventArgs e)
  48. {
  49. Entities entities = new Entities();
  50. Reks.ItemsSource = entities.Client.Where(x => x.id_Gender == 2).ToList();
  51. }
  52. public void Poisk(object sender, RoutedEventArgs e)
  53. {
  54. Entities entities = new Entities();
  55. string S = Poiskk.Text;
  56. Reks.ItemsSource= entities.Client.Where(x=>x.Surname.StartsWith(S) || x.Name.StartsWith(S) ).ToList();
  57. }
  58. }
  59. }