diff --git a/Authorization.cs b/Authorization.cs index 71c3b5a..e64cfa9 100644 --- a/Authorization.cs +++ b/Authorization.cs @@ -28,7 +28,7 @@ namespace AwesomeEmailExtractor return new User(reader.GetInt32(0), reader.GetString(1), (UserRoles)reader.GetInt32(2)); } - throw new Exception("Пользователь не найден!"); + throw new Exception("Неверные данные для входа!"); } public static User Register(string login, string password) diff --git a/AuthorizationForm.cs b/AuthorizationForm.cs index 741cb61..cee06d7 100644 --- a/AuthorizationForm.cs +++ b/AuthorizationForm.cs @@ -21,6 +21,12 @@ namespace AwesomeEmailExtractor { try { + if (string.IsNullOrEmpty(entryLogin.Text) || string.IsNullOrEmpty(entryPassword.Text)) + { + MessageBox.Show("Введите логин и пароль"); + return; + } + Globals.currentUser = Authorization.Login(entryLogin.Text, entryPassword.Text); Logs.Log(Globals.currentUser, Logs.Action.Login, new Dictionary()); diff --git a/EditUserForm.cs b/EditUserForm.cs index 73024ba..91b4fbc 100644 --- a/EditUserForm.cs +++ b/EditUserForm.cs @@ -35,6 +35,12 @@ namespace AwesomeEmailExtractor private void submitButton_Click(object sender, EventArgs e) { + if (loginTextBox.Text.Length == 0) + { + MessageBox.Show("Логин не может быть пустым!"); + return; + } + AdminUtils adminUtils = new AdminUtils(Globals.currentUser); User editedUser = new User(User.ID, loginTextBox.Text, (UserRoles)roleComboBox.SelectedIndex); diff --git a/RegistrationForm.cs b/RegistrationForm.cs index 308f39b..f576b67 100644 --- a/RegistrationForm.cs +++ b/RegistrationForm.cs @@ -19,6 +19,12 @@ namespace AwesomeEmailExtractor private void registerButton_Click(object sender, EventArgs e) { + if (string.IsNullOrEmpty(entryLogin.Text) || string.IsNullOrEmpty(entryPassword.Text)) + { + MessageBox.Show("Введите логин и пароль!"); + return; + } + if (!string.Equals(entryPassword.Text, entryRePassword.Text)) { MessageBox.Show("Пароли не совпадают!"); diff --git a/SettingsForm.cs b/SettingsForm.cs index 287829d..1cde078 100644 --- a/SettingsForm.cs +++ b/SettingsForm.cs @@ -36,6 +36,12 @@ namespace AwesomeEmailExtractor private void changePasswordButton_Click(object sender, EventArgs e) { + if (string.IsNullOrEmpty(entryNewPassword.Text)) + { + MessageBox.Show("Введите пароль!"); + return; + } + if (!string.Equals(entryNewPassword.Text, entryRePassword.Text)) { MessageBox.Show("Пароли не совпадают!");