private void butDelete_Click(object sender, EventArgs e) { if (MessageBox.Show(this, Lans.g(this, "Delete this entire connection group?"), "", MessageBoxButtons.YesNo) == DialogResult.No) { return; } ConnGroupAttaches.DeleteForGroup(ConnectionGroupCur.ConnectionGroupNum); ConnectionGroups.Delete(ConnectionGroupCur.ConnectionGroupNum); DialogResult = DialogResult.OK; }
private void FormCentralConnectionGroupEdit_FormClosing(object sender, FormClosingEventArgs e) { if (DialogResult == DialogResult.OK) { return; } if (ConnectionGroupCur.IsNew) { ConnGroupAttaches.DeleteForGroup(ConnectionGroupCur.ConnectionGroupNum); ConnectionGroups.Delete(ConnectionGroupCur.ConnectionGroupNum); } }
private void butAdd_Click(object sender, EventArgs e) { ConnectionGroup connGroup = new ConnectionGroup(); connGroup.Description = ""; connGroup.ConnectionGroupNum = ConnectionGroups.Insert(connGroup); FormCentralConnectionGroupEdit FormCCGE = new FormCentralConnectionGroupEdit(); FormCCGE.ConnectionGroupCur = connGroup; FormCCGE.IsNew = true; FormCCGE.ShowDialog(); if (FormCCGE.DialogResult == DialogResult.OK) { if (FormCCGE.ConnectionGroupCur == null) { ConnectionGroups.Delete(connGroup.ConnectionGroupNum); } else { _listCentralConnGroups.Add(connGroup); } } FillGrid(); }