private void btnCreate_Click(object sender, RoutedEventArgs e) { if (txtAppId.Text.IsNullOrEmpty()) { MessageBox.Show("Application Id не может быть пустым"); return; } using (ConfigurationManager man = new ConfigurationManager()) { UserData data = new UserData(); data.UserName = txtUserName.Text; data.Password = txtUserPassword.Text; data.Email = txtEmail.Text; data.AppId = long.Parse(txtAppId.Text); data.AccessKey = txtAccessKey.Text; if (man.CreateUser(data)) MessageBox.Show("Пользователь успешено создан", "Информация", MessageBoxButton.OK, MessageBoxImage.Information); else MessageBox.Show("Ошибка создания пользователя", "Информация", MessageBoxButton.OK, MessageBoxImage.Error); } Refresh(); }