Variant.xaml.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. DragMove();
  40. }
  41. //Выход из приложения
  42. private void Close(object sender, RoutedEventArgs e)
  43. {
  44. Application.Current.Shutdown();
  45. }
  46. //Возврат к окну авторизации
  47. private void Back(object sender, RoutedEventArgs e)
  48. {
  49. MainWindow mainWindow = new MainWindow();
  50. this.Close();
  51. mainWindow.Show();
  52. }
  53. //Переход к окну клиентов
  54. private void KlientGO_Click(object sender, RoutedEventArgs e)
  55. {
  56. Client client = new Client();
  57. client.idadmintxt.Text = idadmintxt.Text;
  58. this.Close();
  59. client.Show();
  60. }
  61. //Переход к окну комнат
  62. private void RoomGO_Click(object sender, RoutedEventArgs e)
  63. {
  64. Room room = new Room();
  65. room.idadmintxt.Text = idadmintxt.Text;
  66. this.Close();
  67. room.Show();
  68. }
  69. //Свернуть окно
  70. private void WindMin_Click(object sender, RoutedEventArgs e)
  71. {
  72. this.WindowState = WindowState.Minimized;
  73. }
  74. //Переход к окну работников
  75. private void StaffGO_Click(object sender, RoutedEventArgs e)
  76. {
  77. Staff staff = new Staff();
  78. staff.idadmintxt.Text = idadmintxt.Text;
  79. this.Close();
  80. staff.Show();
  81. }
  82. //Переход к окну заселения
  83. private void ZaselenieGO_Click(object sender, RoutedEventArgs e)
  84. {
  85. ClientRoom clientRoom = new ClientRoom();
  86. clientRoom.idadmintxt.Text = idadmintxt.Text;
  87. this.Close();
  88. clientRoom.Show();
  89. }
  90. //Переход к окну резервирования
  91. private void RezervirovanieGO_Click(object sender, RoutedEventArgs e)
  92. {
  93. Rezerv rezerv = new Rezerv();
  94. rezerv.idadmintxt.Text = idadmintxt.Text;
  95. this.Close();
  96. rezerv.Show();
  97. }
  98. }
  99. }