private void roleAddButton_Click(object sender, EventArgs e) { if (RoleNameTextBox.Text != "") { try { using (WarehouseServiceClient wwsClient = new WarehouseServiceClient("HTTP")) { wwsClient.CreateOrUpdateRole(new Role() { Name = RoleNameTextBox.Text }); } } catch { } mainForm.Enabled = true; mainForm.RoleDataGridRefresh(); Close(); } else { MessageBox.Show("Wrong role name."); } }