Пример #1
0
        private void gridSubs_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            if (_viewMode == FormBugSubmissionMode.ViewOnly)           //Not allowed to create a bug.
            {
                return;
            }
            List <BugSubmission> listSubs = (List <BugSubmission>)gridSubs.ListGridRows[e.Row].Tag;        //Because it is a double click, we know there will only be 1 item in list

            if (_viewMode == FormBugSubmissionMode.SelectionMode)
            {
                ListSelectedSubs = listSubs;
                DialogResult     = DialogResult.OK;
                return;
            }
            //The only time listSubs will have more than 1 item in it is when grouping.
            //The grouping logic ensures that all grouped items have the same bugid
            if (listSubs[0].BugId != 0)
            {
                OpenBug(listSubs[0]);
            }
            else
            {
                FormBugSubmission formBugSub = new FormBugSubmission(listSubs[0], _jobCur);
                formBugSub.Show();
            }
        }
Пример #2
0
        private void gridSubs_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            if (e.Row == -1)
            {
                return;
            }
            FormBugSubmission formBugSub = new FormBugSubmission(_listBugSubs[e.Row]);

            formBugSub.Show();
        }
Пример #3
0
        ///<summary></summary>
        private void gridSubs_RightClickHelper(object sender, EventArgs e)
        {
            int index = gridSubs.GetSelectedIndex();

            if (index == -1)           //Should not happen, menu item is only enabled when exactly 1 row is selected.
            {
                return;
            }
            List <BugSubmission> listSubs;

            switch (((MenuItem)sender).Index)
            {
            case 0:                    //Open Submission
                listSubs = (List <BugSubmission>)gridSubs.ListGridRows[index].Tag;
                FormBugSubmission formBugSub = new FormBugSubmission(listSubs[0], _jobCur);
                formBugSub.Show();
                break;

            case 1:                    //Open Bug
                listSubs = (List <BugSubmission>)gridSubs.ListGridRows[index].Tag;
                OpenBug(listSubs[0]);
                break;

            case 2:                                           //Hide or Unhide submission
                listSubs = gridSubs.SelectedTags <List <BugSubmission> >().SelectMany(x => x.ToList()).ToList();
                bool isHidden = (!listSubs.First().IsHidden); //Flip all grouped submissions based on what the user selected/sees in the grid.
                listSubs.ForEach(x => x.IsHidden = isHidden);
                BugSubmissions.UpdateMany(listSubs, "IsHidden");
                FillSubGrid(true);
                break;

            case 3:                              //Link or Unlink bug
                listSubs = gridSubs.SelectedTags <List <BugSubmission> >().SelectMany(x => x.ToList()).ToList();
                if (listSubs.First().BugId == 0) //Not linked to existing bug, so link
                {
                    FormBugSearch formBS = new FormBugSearch(new Job());
                    if (formBS.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    listSubs.ForEach(x => x.BugId = formBS.BugCur.BugId);
                    BugSubmissionHashes.UpdateBugIds(listSubs, formBS.BugCur.BugId);
                }
                else                          //Unlink
                {
                    listSubs.ForEach(x => x.BugId = 0);
                    BugSubmissionHashes.UpdateBugIds(listSubs, 0);
                }
                BugSubmissions.UpdateMany(listSubs, "BugId");
                FillSubGrid(true);
                break;
            }
        }
Пример #4
0
        ///<summary>Click method used by all gridClaimDetails right click options.</summary>
        private void gridClaimDetails_RightClickHelper(object sender, EventArgs e)
        {
            int index = gridSubs.GetSelectedIndex();

            if (index == -1)           //Should not happen, menu item is only enabled when exactly 1 row is selected.
            {
                return;
            }
            List <BugSubmission> listSubs = (List <BugSubmission>)gridSubs.Rows[index].Tag;

            switch (((MenuItem)sender).Index)
            {
            case 0:                    //Open Submission
                FormBugSubmission formBugSub = new FormBugSubmission(listSubs[0], _jobCur);
                formBugSub.Show();
                break;

            case 1:                    //Open Bug
                OpenBug(listSubs[0]);
                break;
            }
        }