FeaturesMenuUserControl.xaml.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using OOO_WriteAndClear.DBModels;
  2. using OOO_WriteAndClear.EventBus.Signals;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace OOO_WriteAndClear.MVP.Views
  18. {
  19. /// <summary>
  20. /// Логика взаимодействия для FeaturesMenuUserControl.xaml
  21. /// </summary>
  22. public partial class FeaturesMenuUserControl : UserControl
  23. {
  24. public FeaturesMenuUserControl()
  25. {
  26. InitializeComponent();
  27. SetUserData();
  28. }
  29. private void SetUserData()
  30. {
  31. User user = (User)Application.Current.Resources["CurrentUser"];
  32. DisplayingUserName.Text = user.UserSurname
  33. + " "
  34. + user.UserName
  35. + " "
  36. + user.UserPatronymic;
  37. DisplayingUserRole.Text = user.UserRoleNavigation.RoleName;
  38. }
  39. private void Exit_ButtonClick(object sender, RoutedEventArgs e)
  40. {
  41. EventBus.EventBus.GetService().Invoke(new BackToAuthorizationUserControlSignal());
  42. }
  43. private void GoToOrdersUserControl_ButtonClick(object sender, RoutedEventArgs e)
  44. {
  45. EventBus.EventBus.GetService().Invoke(new GoToOrdersUserControlSignal());
  46. }
  47. private void GoToProductsUserControl_ButtonClick(object sender, RoutedEventArgs e)
  48. {
  49. EventBus.EventBus.GetService().Invoke(new GoToProductsUserControlSignal());
  50. }
  51. }
  52. }