HomePage.xaml.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 School
  16. {
  17. /// <summary>
  18. /// Логика взаимодействия для HomePage.xaml
  19. /// </summary>
  20. public partial class HomePage : Page
  21. {
  22. public static string code;
  23. public HomePage()
  24. {
  25. InitializeComponent();
  26. }
  27. public HomePage(string code)
  28. {
  29. InitializeComponent();
  30. if (code == "0000")
  31. {
  32. Note.Visibility = Visibility.Visible;
  33. }
  34. else
  35. {
  36. Note.Visibility = Visibility.Collapsed;
  37. }
  38. }
  39. private void Admin_Click(object sender, RoutedEventArgs e)
  40. {
  41. WindowAdmin windowPerson = new WindowAdmin();
  42. windowPerson.ShowDialog();
  43. if (code == "0000")
  44. {
  45. Note.Visibility = Visibility.Visible;
  46. }
  47. else
  48. {
  49. Note.Visibility = Visibility.Collapsed;
  50. }
  51. }
  52. private void Note_Click(object sender, RoutedEventArgs e)
  53. {
  54. ClassFrame.newFrame.Navigate(new PageNearNote());
  55. }
  56. private void Services_Click(object sender, RoutedEventArgs e)
  57. {
  58. ClassFrame.newFrame.Navigate(new PageListOfService());
  59. }
  60. }
  61. }