Variant.xaml.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. using System.Windows.Threading;
  15. namespace HotelCalifornia
  16. {
  17. /// <summary>
  18. /// Логика взаимодействия для Variant.xaml
  19. /// </summary>
  20. public partial class Variant : Window
  21. {
  22. public Variant()
  23. {
  24. InitializeComponent();
  25. //Таймер на обновление времени
  26. DispatcherTimer timer = new DispatcherTimer();
  27. timer.Tick += new EventHandler(Update_Timer_Tick);
  28. timer.Interval = new TimeSpan(0, 0, 1);
  29. timer.Start();
  30. }
  31. //Вывод даты и время в textblock
  32. private void Update_Timer_Tick(object sender, EventArgs e)
  33. {
  34. timetxt.Text = DateTime.Now.ToString();
  35. }
  36. //Перетаскивание окна
  37. private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
  38. {
  39. try
  40. {
  41. DragMove();
  42. }
  43. catch
  44. {
  45. }
  46. }
  47. //Выход из приложения
  48. private void Close(object sender, RoutedEventArgs e)
  49. {
  50. Application.Current.Shutdown();
  51. }
  52. //Возврат к окну авторизации
  53. private void Back(object sender, RoutedEventArgs e)
  54. {
  55. MainWindow mainWindow = new MainWindow();
  56. this.Close();
  57. mainWindow.Show();
  58. }
  59. //Переход к окну клиентов
  60. private void KlientGO_Click(object sender, RoutedEventArgs e)
  61. {
  62. Client client = new Client();
  63. client.idadmintxt.Text = idadmintxt.Text;
  64. this.Close();
  65. client.Show();
  66. }
  67. //Переход к окну комнат
  68. private void RoomGO_Click(object sender, RoutedEventArgs e)
  69. {
  70. Room room = new Room();
  71. room.idadmintxt.Text = idadmintxt.Text;
  72. this.Close();
  73. room.Show();
  74. }
  75. //Свернуть окно
  76. private void WindMin_Click(object sender, RoutedEventArgs e)
  77. {
  78. this.WindowState = WindowState.Minimized;
  79. }
  80. //Переход к окну отчетов
  81. private void ReportGO_Click(object sender, RoutedEventArgs e)
  82. {
  83. Report report = new Report();
  84. report.idadmintxt.Text = idadmintxt.Text;
  85. this.Close();
  86. report.Show();
  87. }
  88. //Переход к окну заселения
  89. private void ZaselenieGO_Click(object sender, RoutedEventArgs e)
  90. {
  91. ClientRoom clientRoom = new ClientRoom();
  92. clientRoom.idadmintxt.Text = idadmintxt.Text;
  93. this.Close();
  94. clientRoom.Show();
  95. }
  96. //Переход к окну резервирования
  97. private void RezervirovanieGO_Click(object sender, RoutedEventArgs e)
  98. {
  99. Rezerv rezerv = new Rezerv();
  100. rezerv.idadmintxt.Text = idadmintxt.Text;
  101. this.Close();
  102. rezerv.Show();
  103. }
  104. }
  105. }