Esempio n. 1
0
        private void FormBugSubmission_Load(object sender, EventArgs e)
        {
            try {
                RegistrationKey key = RegistrationKeys.GetByKey(_subCur.RegKey);
                _patCur = Patients.GetPat(key.PatNum);
            }
            catch (Exception ex) {
                ex.DoNothing();
                _patCur = new Patient();              //Just in case, needed mostly for debug.
            }
            labelName.Text     = _patCur?.GetNameLF() ?? "";
            labelDateTime.Text = POut.DateT(_subCur.SubmissionDateTime);
            labelVersion.Text  = _subCur.TryGetPrefValue(PrefName.ProgramVersion, "0.0.0.0");
            labelHashNum.Text  = POut.Long(_subCur.BugSubmissionHashNum);
            if (_subCur.BugId != 0)           //Already associated to a bug
            {
                _bug = Bugs.GetOne(_subCur.BugId);
                butAddViewBug.Text = "View Bug";
            }
            if (_bug != null)
            {
                _listLinks = JobLinks.GetForType(JobLinkType.Bug, _bug.BugId);
                if (_listLinks.Count == 1)
                {
                    butAddViewJob.Text = "View Job";
                }
            }
            Dictionary <string, Patient> dictPats = new Dictionary <string, Patient>();

            dictPats.Add(_subCur.RegKey, _patCur);
            bugSubmissionControl.RefreshData(dictPats, -1, null);          //New selelction, refresh control data.
            bugSubmissionControl.RefreshView(_subCur);
        }
Esempio n. 2
0
        ///<summary>Returns the commit message for this job. Job should not be null.</summary>
        private string GetCommitMessage(Job job)
        {
            string description;

            if (job.Category == JobCategory.Bug)
            {
                Bug    bug            = Bugs.GetOne(job.ListJobLinks.Where(x => x.LinkType == JobLinkType.Bug).FirstOrDefault()?.FKey ?? 0);
                string bugDescription = "";
                if (bug != null)
                {
                    bugDescription = bug.Description.Replace("\"", "");
                }
                else
                {
                    bugDescription = job.Title;
                }
                description = job.Category.ToString().Substring(0, 1) + job.JobNum + " - "
                              + bugDescription;
            }
            else
            {
                description = job.Category.ToString().Substring(0, 1) + job.JobNum + " - " + job.Title;
            }
            string reviewers = string.Join(", ", job.ListJobReviews
                                           .Where(x => x.ReviewStatus == JobReviewStatus.Done || x.ReviewStatus == JobReviewStatus.NeedsAdditionalReview)
                                           .DistinctBy(x => x.ReviewerNum)
                                           .Select(x => Userods.GetName(x.ReviewerNum))
                                           .OrderBy(x => x)
                                           .ToList());

            return($"{POut.String(description)}\r\nBackported to: {POut.String(job.JobVersion)}\r\nReviewed by: {POut.String(reviewers)}");
        }
Esempio n. 3
0
        private void gridBugs_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            FormBugEdit FormBE = new FormBugEdit();

            FormBE.BugCur = Bugs.GetOne((long)gridBugs.Rows[e.Row].Tag);
            FormBE.ShowDialog();
            if (FormBE.BugCur == null)
            {
                _listJobLinks.RemoveAll(x => x.LinkType == JobLinkType.Bug && x.FKey == (long)gridBugs.Rows[e.Row].Tag);
            }
            FillGridBugs();
        }
Esempio n. 4
0
        private void OpenBug(BugSubmission sub)
        {
            if (!JobPermissions.IsAuthorized(JobPerm.Concept, true) &&
                !JobPermissions.IsAuthorized(JobPerm.NotifyCustomer, true) &&
                !JobPermissions.IsAuthorized(JobPerm.FeatureManager, true) &&
                !JobPermissions.IsAuthorized(JobPerm.Documentation, true))
            {
                return;
            }
            FormBugEdit FormBE = new FormBugEdit();

            FormBE.BugCur = Bugs.GetOne(sub.BugId);
            if (FormBE.ShowDialog() == DialogResult.OK && FormBE.BugCur == null)         //Bug was deleted.
            {
                FillSubGrid(true);
            }
        }
Esempio n. 5
0
 private void FormBugSubmission_Load(object sender, EventArgs e)
 {
     textStack.Text     = _sub.ExceptionMessageText + "\r\n" + _sub.ExceptionStackTrace;
     labelRegKey.Text   = _sub.RegKey;
     labelDateTime.Text = POut.DateT(_sub.SubmissionDateTime);
     labelVersion.Text  = _sub.Info.DictPrefValues[PrefName.ProgramVersion];
     if (_sub.BugId != 0)           //Already associated to a bug
     {
         _bug = Bugs.GetOne(_sub.BugId);
         butAddViewBug.Text = "View Bug";
     }
     if (_bug != null)
     {
         _listLinks = JobLinks.GetForType(JobLinkType.Bug, _bug.BugId);
         if (_listLinks.Count == 1)
         {
             butAddViewJob.Text = "View Job";
         }
     }
     FillOfficeInfoGrid(_sub);
     SetCustomerInfo(_sub);
 }
Esempio n. 6
0
        private void FillGridBugs()
        {
            gridBugs.BeginUpdate();
            gridBugs.Columns.Clear();
            gridBugs.Columns.Add(new ODGridColumn("Bug Num (From JRMT)", -1));
            gridBugs.Columns.Add(new ODGridColumn("Unlink", 40, HorizontalAlignment.Center));
            gridBugs.Rows.Clear();
            List <JobLink> listBugLinks = _listJobLinks.FindAll(x => x.LinkType == JobLinkType.Bug).ToList();

            for (int i = 0; i < listBugLinks.Count; i++)
            {
                Bug       bug = Bugs.GetOne(listBugLinks[i].FKey);
                ODGridRow row = new ODGridRow()
                {
                    Tag = listBugLinks[i].FKey
                };                                                                         //bugNum
                row.Cells.Add(bug == null ? "Invalid Bug" : bug.Description);
                row.Cells.Add("X");
                gridBugs.Rows.Add(row);
            }
            gridBugs.EndUpdate();
        }