private void butOK_Click(object sender, System.EventArgs e) { if (textDescription.Text == "") { MsgBox.Show(this, "Please enter a description."); return; } CurGroup.Description = textDescription.Text; try{ UserGroups.InsertOrUpdate(CurGroup, IsNew); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } DialogResult = DialogResult.OK; }