From 46cc1d3463212ade9e50830deeec6cd9e4bd2203 Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Wed, 25 May 2022 08:23:03 +0300 Subject: [PATCH] =?UTF-8?q?=D1=85=D0=BE=D1=82=D1=84=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EditUserForm.cs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/EditUserForm.cs b/EditUserForm.cs index 49a170b..1109d24 100644 --- a/EditUserForm.cs +++ b/EditUserForm.cs @@ -45,14 +45,23 @@ namespace AwesomeEmailExtractor User editedUser = new User(User.ID, loginTextBox.Text, (UserRoles)roleComboBox.SelectedIndex); - if (passwordTextBox.Text != "") - { - adminUtils.editUser(editedUser, passwordTextBox.Text); - } - else + try { - adminUtils.editUser(editedUser); + if (passwordTextBox.Text != "") + { + adminUtils.editUser(editedUser, passwordTextBox.Text); + } + else + { + + adminUtils.editUser(editedUser); + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; } this.Close();