예제 #1
0
        private void btnSubmitGroup1_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string newUsername = ValidateUser.ValidateUsername(tbUsername.Text, _selectedUser.username.Trim());

                Authentification.ChangeUsername(_userId, tbUsername.Text);

                Authentification.ChangeUserRole(_userId, cbRole.Text);

                DialogHelper.ShowInfo("Požadované změny byly úspěšně provedeny.");

                InitializeInterface();
            }
            catch (InvalidUsernameException ex)
            {
                DialogHelper.ShowWarning(ex.Message);
            }
            catch (UsernameAlreadyExistsException ex)
            {
                DialogHelper.ShowWarning(ex.Message);
            }
            catch
            {
                DialogHelper.ShowError("Kvůli neočekávané chybě operace selhala.");
            }
        }