|
@@ -24,6 +24,7 @@ namespace InteractiveKiosk
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
}
|
|
|
+
|
|
|
//public void TextBox_GotFocus(object sender, RoutedEventArgs e)
|
|
|
//{
|
|
|
// TextBox tb = (TextBox)sender;
|
|
@@ -34,30 +35,41 @@ namespace InteractiveKiosk
|
|
|
private const string defaultText = "Логин";
|
|
|
private const string defaultText1 = "Пароль";
|
|
|
|
|
|
- private void TextBox_GotFocus(object sender, RoutedEventArgs e)
|
|
|
+ private void Username_GotFocus(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
- username.Text = username.Text == defaultText ?
|
|
|
+ username.Text = username.Text == defaultText ?
|
|
|
string.Empty : username.Text;
|
|
|
- password.Password = password.Password == defaultText1 ?
|
|
|
- string.Empty : password.Password;
|
|
|
+ username.Foreground = Brushes.Gray;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void Password_GotFocus(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ password.Text = password.Text == defaultText1 ?
|
|
|
+ string.Empty : password.Text;
|
|
|
}
|
|
|
|
|
|
- private void TextBox_LostFocus(object sender, RoutedEventArgs e)
|
|
|
+ private void Username_LostFocus(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
username.Text = username.Text == string.Empty ?
|
|
|
defaultText : username.Text;
|
|
|
- password.Password = password.Password == string.Empty ?
|
|
|
- defaultText1 : password.Password;
|
|
|
+ username.Foreground = Brushes.Gray;
|
|
|
+ }
|
|
|
+ private void Password_LostFocus(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ password.Text = password.Text == string.Empty ?
|
|
|
+ defaultText1 : password.Text;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private void LoginButton(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
- if (username.Text == "" || password.Password == "")
|
|
|
+ if (username.Text == "" || password.Text == "")
|
|
|
{
|
|
|
MessageBox.Show("Введено неверное значение!");
|
|
|
return;
|
|
|
}
|
|
|
- if (db.ParkManagers.Select(item => item.Username + " " + item.Password).Contains(username.Text + " " + password.Password))
|
|
|
+ if (db.ParkManagers.Select(item => item.Username + " " + item.Password).Contains(username.Text + " " + password.Text))
|
|
|
{
|
|
|
MessageBox.Show("Добро пожаловать, вы авторизированы");
|
|
|
//MenuWindow mw = new MenuWindow();
|