예제 #1
0
 private DataTable GetIncompleteProcNotes()
 {
     RpProcNote.ProcNoteGroupBy groupBy;
     if (radioPatient.Checked)
     {
         groupBy = RpProcNote.ProcNoteGroupBy.Patient;
     }
     else if (radioProcDate.Checked)
     {
         groupBy = RpProcNote.ProcNoteGroupBy.DateAndPatient;
     }
     else
     {
         groupBy = RpProcNote.ProcNoteGroupBy.Procedure;
     }
     return(RpProcNote.GetData(_listSelectedProvNums, comboBoxMultiClinics.ListSelectedClinicNums, dateRangePicker.GetDateTimeFrom(),
                               dateRangePicker.GetDateTimeTo(), checkNoNotes.Checked, checkUnsignedNote.Checked,
                               (ToothNumberingNomenclature)PrefC.GetInt(PrefName.UseInternationalToothNumbers), groupBy));
 }
예제 #2
0
 private void FillGrids(bool isRefreshNeeded = true)
 {
     if (_patCur == null || gridBugsFixed == null)         //Just in case.
     {
         return;
     }
     gridBugsInProgress.BeginUpdate();
     gridBugsFixed.BeginUpdate();
     gridBugSubmissions.BeginUpdate();
     #region Init Columns
     if (gridBugsFixed.ListGridColumns.Count == 0)
     {
         gridBugsInProgress.ListGridColumns.Add(new GridColumn("Description", -1));
         gridBugsInProgress.ListGridColumns.Add(new GridColumn("Expert", 55, HorizontalAlignment.Center));
         gridBugsInProgress.ListGridColumns.Add(new GridColumn("Has Job", 55, HorizontalAlignment.Center));
         gridBugsFixed.ListGridColumns.Add(new GridColumn("Description", -1));
         gridBugsFixed.ListGridColumns.Add(new GridColumn("Vers.", 55, HorizontalAlignment.Center));
         gridBugsFixed.ListGridColumns.Add(new GridColumn("Has Job", 55, HorizontalAlignment.Center));
         gridBugSubmissions.ListGridColumns.Add(new GridColumn("Description", -1));
         gridBugSubmissions.ListGridColumns.Add(new GridColumn("Vers.", 55, HorizontalAlignment.Center));
         gridBugSubmissions.ListGridColumns.Add(new GridColumn("Has Job", 55, HorizontalAlignment.Center));
     }
     #endregion
     if (isRefreshNeeded)
     {
         List <string> listKeys = RegistrationKeys.GetForPatient(_patCur.PatNum).Select(x => x.RegKey).ToList();
         try {
             _listBugSubs = BugSubmissions.GetBugSubsForRegKeys(listKeys, datePickerHqBugSub.GetDateTimeFrom(), datePickerHqBugSub.GetDateTimeTo());
         }
         catch (Exception ex) {               //Should only occur if running in debug at HQ and no bugs database on local machine.
             ex.DoNothing();
             label1.Text = "NO BUGS DB";      //Inform dev of issue.
         }
         _listJobLinks = JobLinks.GetManyForType(JobLinkType.Bug, _listBugSubs.Select(x => x.BugId).ToList());
         List <long> listNewBugUserIds = _listBugSubs.Where(x => x.BugObj != null && !_dictHqBugSubNames.ContainsKey(x.BugObj.Submitter))
                                         .Select(x => x.BugObj.Submitter).ToList();
         if (listNewBugUserIds.Count > 0)
         {
             Bugs.GetDictSubmitterNames(listNewBugUserIds).ToList()
             .ForEach(x => _dictHqBugSubNames[x.Key] = x.Value);
         }
     }
     gridBugsInProgress.ListGridRows.Clear();
     gridBugsFixed.ListGridRows.Clear();
     gridBugSubmissions.ListGridRows.Clear();
     List <long> listBugNums = new List <long>();        //Keep track of BubIds so that we do not show duplicates.
     foreach (BugSubmission sub in _listBugSubs)
     {
         bool   hasJob     = (_listJobLinks.Any(x => x.FKey == sub.BugObj?.BugId));
         string expertName = (sub.BugObj == null ? "" : _dictHqBugSubNames[sub.BugObj.Submitter].ToUpperFirstOnly());
         if (sub.BugObj != null && !listBugNums.Contains(sub.BugObj.BugId))          //BugSubmission has an associated bug and it is not a duplicate.
         {
             if (string.IsNullOrEmpty(sub.BugObj.VersionsFixed))                     //Bug is not fixed
             {
                 #region In Progress grid
                 listBugNums.Add(sub.BugObj.BugId);
                 GridRow rowBug = new GridRow(sub.BugObj.Description,
                                              expertName,
                                              (hasJob?"X":"")
                                              );
                 rowBug.Tag = sub.BugObj;
                 gridBugsInProgress.ListGridRows.Add(rowBug);
                 #endregion
             }
             else                      //Bug is fixed
             {
                 #region Fixed grid
                 listBugNums.Add(sub.BugObj.BugId);
                 GridRow rowBug = new GridRow(sub.BugObj.Description + "\r\nEXPERT: " + expertName,
                                              sub.BugObj.VersionsFixed.Replace(';', '\n'),
                                              (hasJob?"X":"")
                                              );
                 rowBug.Tag = sub.BugObj;
                 gridBugsFixed.ListGridRows.Add(rowBug);
                 #endregion
             }
         }
         #region All grid
         GridRow rowSub = new GridRow(sub.ExceptionMessageText + "\r\n"
                                      + sub.SubmissionDateTime.ToString("MM/dd/yyyy HH:mm:ss", CultureInfo.InvariantCulture)
                                      + "\r\nEXPERT: " + expertName,
                                      sub.TryGetPrefValue(PrefName.ProgramVersion, "0.0.0.0"),
                                      (hasJob?"X":"")
                                      );
         rowSub.Tag = sub;
         gridBugSubmissions.ListGridRows.Add(rowSub);
         #endregion
     }
     gridBugsInProgress.EndUpdate();
     gridBugsFixed.EndUpdate();
     gridBugSubmissions.EndUpdate();
 }