AuthorizationWindow.xaml.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.Specialized;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Shapes;
  15. namespace InteractiveKiosk
  16. {
  17. /// <summary>
  18. /// Interaction logic for AuthorizationWindow.xaml
  19. /// </summary>
  20. public partial class AuthorizationWindow : Window
  21. {
  22. InteractiveKioskEntities db = new InteractiveKioskEntities();
  23. public AuthorizationWindow()
  24. {
  25. InitializeComponent();
  26. }
  27. private void LoginButton(object sender, RoutedEventArgs e)
  28. {
  29. //if (username.Text == "" || password.Text == "")
  30. //{
  31. // MessageBox.Show("Введено неверное значение!");
  32. // return;
  33. //}
  34. //if (db.ParkManagers.Select(item => item.Username + " " + item.Password).Contains(username.Text + " " + password.Text))
  35. //{
  36. // MessageBox.Show("Добро пожаловать, вы авторизированы");
  37. // this.Close();
  38. //}
  39. //else
  40. //{
  41. // MessageBox.Show("Введено неверное значение логина/пароля");
  42. //}
  43. }
  44. private void MinButton_MouseDown(object sender, MouseButtonEventArgs e)
  45. {
  46. this.WindowState = WindowState.Minimized;
  47. }
  48. private void ExitButton_MouseDown(object sender, MouseButtonEventArgs e)
  49. {
  50. this.Close();
  51. }
  52. private void Authorization_MouseDown(object sender, MouseButtonEventArgs e)
  53. {
  54. if (e.ChangedButton == MouseButton.Left)
  55. {
  56. this.DragMove();
  57. }
  58. }
  59. private void OnPasswordChanged(object sender, RoutedEventArgs e)
  60. {
  61. if(Password.Password.Length > 0)
  62. {
  63. Watermark.Visibility = Visibility.Collapsed;
  64. }
  65. else
  66. {
  67. Watermark.Visibility = Visibility.Visible;
  68. }
  69. }
  70. private void PasswordChecked(object sender, RoutedEventArgs e)
  71. {
  72. if (Password.Password.Length > 0)
  73. {
  74. Password.Visibility = Visibility.Visible;
  75. }
  76. }
  77. }
  78. }