Client.xaml.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 HotelCalifornia
  15. {
  16. /// <summary>
  17. /// Логика взаимодействия для Client.xaml
  18. /// </summary>
  19. public partial class Client : Window
  20. {
  21. public Client()
  22. {
  23. InitializeComponent();
  24. }
  25. //Перетаскивание окна
  26. private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
  27. {
  28. DragMove();
  29. }
  30. //Возврат к окну выбора функции
  31. private void Back(object sender, RoutedEventArgs e)
  32. {
  33. MessageBoxResult result = MessageBox.Show("Вы хотите вернуться к предыдущему окну?", "Предупреждение", MessageBoxButton.YesNo, MessageBoxImage.Question);
  34. switch (result)
  35. {
  36. case MessageBoxResult.Yes:
  37. Variant variant = new Variant();
  38. this.Close();
  39. variant.Show();
  40. break;
  41. case MessageBoxResult.No:
  42. break;
  43. }
  44. }
  45. //Выход из приложения
  46. private void Close(object sender, RoutedEventArgs e)
  47. {
  48. MessageBoxResult result = MessageBox.Show("Вы хотите выйти из приложения?", "Предупреждение", MessageBoxButton.YesNo, MessageBoxImage.Question);
  49. switch (result)
  50. {
  51. case MessageBoxResult.Yes:
  52. Application.Current.Shutdown();
  53. break;
  54. case MessageBoxResult.No:
  55. break;
  56. }
  57. }
  58. }
  59. }