ListStudentPage.xaml.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 ProjectAnalogParus
  16. {
  17. /// <summary>
  18. /// Логика взаимодействия для ListStudentPage.xaml
  19. /// </summary>
  20. public partial class ListStudentPage : Page
  21. {
  22. gr672_bdaEntities db = new gr672_bdaEntities();
  23. public ListStudentPage()
  24. {
  25. InitializeComponent();
  26. }
  27. private void LoadedWindows(object sender, RoutedEventArgs e)
  28. {
  29. Studentgrid.ItemsSource = db.Student.ToList();
  30. }
  31. private void FullInformation_Click(object sender, RoutedEventArgs e)
  32. {
  33. Student stud = (Student)Studentgrid.SelectedItem;
  34. if (stud != null)
  35. {
  36. FramePage.MainFrame.Navigate(new FullInformationStudentPage(stud.IdStudent));
  37. }
  38. else
  39. {
  40. MessageBox.Show("Не выбрана строка!");
  41. }
  42. }
  43. private void insertStudent_Click(object sender, RoutedEventArgs e)
  44. {
  45. FramePage.MainFrame.Navigate(new FullInformationStudentPage(null));
  46. }
  47. private void DeleteStudent_Click(object sender, RoutedEventArgs e)
  48. {
  49. }
  50. }
  51. }