Browse Source

Добавил проверку логина и пароля (наличие)

Ethosa 3 years ago
parent
commit
4616d964ac

+ 1 - 1
Тураев_БД 11.20.1/Pages/AuthPage.xaml

@@ -27,7 +27,7 @@
         <Label Content="Пароль" Grid.Column="1" Grid.Row="1" VerticalAlignment="Top" Height="26" Margin="0,31,0,0"/>
         <Button Click="ButtonEnter_OnClick" Content="Вход" Grid.Column="2" Margin="0,65,0,0" Grid.Row="1" VerticalAlignment="Top"/>
         <Button Content="Регистрация" Grid.Column="2" Margin="0,90,0,0" Grid.Row="1" VerticalAlignment="Top"/>
-        <PasswordBox Grid.Column="2" Margin="0,32,0,0" Grid.Row="1" VerticalAlignment="Top" Height="25"/>
+        <PasswordBox x:Name="PasswordBox" Grid.Column="2" Margin="0,32,0,0" Grid.Row="1" VerticalAlignment="Top" Height="25"/>
 
     </Grid>
 </Page>

+ 5 - 1
Тураев_БД 11.20.1/Pages/AuthPage.xaml.cs

@@ -27,7 +27,11 @@ namespace Тураев_БД_11._20._1.Pages
 
         private void ButtonEnter_OnClick(object sender, RoutedEventArgs e)
         {
-
+            if (string.IsNullOrEmpty(TextBoxLogin.Text) || string.IsNullOrEmpty(PasswordBox.Password))
+            {
+                MessageBox.Show("Введите логин и пароль!");
+                return;
+            }
         }
     }
 }