public void Client_Delete_Button_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want Delete this client?", "Confirm Deletion", MessageBoxButtons.OKCancel) == DialogResult.OK) { String id = _client.FindID(); _client.Delete(); MClientContract.DeleteAll(id); // _mainForm.SetClientBox(MClient.GetList()); _clientForm.Close(); } }
public void Client_Cancel_Button_Click(object sender, EventArgs e) { if (_clientForm.noChanges) { _clientForm.Close(); } else { if (MessageBox.Show("Are you sure you want to discard?", "Confirm Cancel", MessageBoxButtons.OKCancel) == DialogResult.OK) { _clientForm.Close(); if (_client.isNew()) { MClientContract.DeleteAll(_client.FindID()); } return; } } }