예제 #1
0
        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();
        }
예제 #2
0
        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();
        }