private void butDelete_Click(object sender, EventArgs e) { if (IsNew) { Screens.Delete(ScreenCur); DialogResult = DialogResult.Cancel; if (ScreenPatCur != null) { ScreenPatCur.PatScreenPerm = PatScreenPerm.Unknown; } IsDeleted = true; return; } if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Are you sure you want to delete this screening?")) { return; } if (ScreenPatCur != null) { ScreenPatCur.PatScreenPerm = PatScreenPerm.Unknown; } IsDeleted = true; Screens.Delete(ScreenCur); DialogResult = DialogResult.Cancel; }
private void butDelete_Click(object sender, System.EventArgs e) { if (listMain.SelectedIndices.Count == 0) { MessageBox.Show("Please select items first."); return; } for (int i = 0; i < listMain.SelectedIndices.Count; i++) { Screens.Delete(ScreenList[listMain.SelectedIndices[i]]); } FillGrid(); }
private void butDelete_Click(object sender, EventArgs e) { if (IsNew) { Screens.Delete(ScreenCur); DialogResult = DialogResult.Cancel; return; } if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Are you sure you want to delete this screening?")) { return; } Screens.Delete(ScreenCur); DialogResult = DialogResult.Cancel; }
private void butDelete_Click(object sender, EventArgs e) { if (ScreenList.Length > 0) { if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Are you sure you want to delete this screening group? All screenings in this group will be deleted?")) { return; } } for (int i = 0; i < ScreenList.Length; i++) { Screens.Delete(ScreenList[i]); } ScreenGroups.Delete(ScreenGroupCur); DialogResult = DialogResult.Cancel; }