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{ if (IsNew) { UserGroups.Insert(CurGroup); } else { UserGroups.Update(CurGroup); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } DataValid.SetInvalid(InvalidType.Security); DialogResult = DialogResult.OK; }