private void DeleteAttachment() { if (attachmentsListView.Items.Count == 0) { return; } DialogResult result = MessageBox.Show( Resources.String_AreYouSureYouWantToDeleteAttachments, Resources.String_DeleteAttachments, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, FormUtil.GetMessageBoxOptions(this)); if (result != DialogResult.Yes) { return; } FormUtil.DeleteSelected <Attachment>(attachmentsListView, mContext); // Flush. mContext.Flush(); // Show attachments. ShowAttachments(); }
private void DeleteMilestone() { if (milestonesListView.SelectedItems.Count == 0) { return; } DialogResult result = MessageBox.Show( Resources.String_AreYouSureYouWantToDeleteSelectedMilestonesAndTheirTickets, Resources.String_DeleteMilestones, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, FormUtil.GetMessageBoxOptions(this)); if (result != DialogResult.Yes) { return; } FormUtil.DeleteSelected <Milestone>(milestonesListView, mContext); // Flush. mContext.Flush(); // Show milestones. ShowMilestones(); PopulateTicketFilters(); // Tickets may change as the result of removing a milestone ShowTickets(); mMainForm.UpdateTicket(); }