Handbooks.xaml.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.Shapes;
  14. namespace kursach_2._0.Windows
  15. {
  16. /// <summary>
  17. /// Логика взаимодействия для Handbooks.xaml
  18. /// </summary>
  19. public partial class Handbooks : Window
  20. {
  21. private dealerContext _context;
  22. public Handbooks()
  23. {
  24. InitializeComponent();
  25. _context = new dealerContext();
  26. Load();
  27. }
  28. // вывод данных
  29. public void Load()
  30. {
  31. productsDG.ItemsSource = _context.products.ToList();
  32. distributorDG.ItemsSource = _context.distributors.ToList();
  33. employeesDG.ItemsSource = _context.employees.ToList();
  34. }
  35. // кнопка домой
  36. private void HomeClick(object sender, MouseButtonEventArgs e)
  37. {
  38. Windows.Menu menu = new Windows.Menu();
  39. menu.Show();
  40. Close();
  41. }
  42. // кнопка добавить
  43. private void InsertProduct(object sender, RoutedEventArgs e)
  44. {
  45. Windows.product_insert PI = new Windows.product_insert();
  46. PI.Owner = this;
  47. PI.Show();
  48. }
  49. }
  50. }