private void butDiagnostics_Click(object sender, EventArgs e) { BugSubmission.SubmissionInfo subInfo = new BugSubmission(new Exception()).Info; StringBuilder strBuilder = new StringBuilder(); foreach (FieldInfo field in subInfo.GetType().GetFields()) { object value = field.GetValue(subInfo); if (value.In(null, "")) { continue; } if (value is Dictionary <PrefName, string> ) //DictPrefValues { Dictionary <PrefName, string> dictPrefValues = value as Dictionary <PrefName, string>; if (dictPrefValues.Keys.Count > 0) { strBuilder.AppendLine(field.Name + ":"); dictPrefValues.ToList().ForEach(x => strBuilder.AppendLine(" " + x.Key.ToString() + ": " + x.Value)); strBuilder.AppendLine("-------------"); } } else if (value is List <string> ) //EnabledPlugins { List <string> enabledPlugins = value as List <string>; if (enabledPlugins.Count > 0) { strBuilder.AppendLine(field.Name + ":"); enabledPlugins.ForEach(x => strBuilder.AppendLine(" " + x)); strBuilder.AppendLine("-------------"); } } else if (value is bool) { strBuilder.AppendLine(field.Name + ": " + (((bool)value) == true?"true":"false")); } else { strBuilder.AppendLine(field.Name + ": " + value); } } //Display the current HQ connection information. if (PrefC.IsODHQ) { Action <ConnectionNames> action = (connName) => { strBuilder.AppendLine($"{connName.ToString()}:"); strBuilder.AppendLine($" Server Name: {DataConnection.GetServerName()}"); strBuilder.AppendLine($" Database Name: {DataConnection.GetDatabaseName()}"); strBuilder.AppendLine($" MySQL User: {DataConnection.GetMysqlUser()}"); strBuilder.AppendLine($" MySQL Password: {DataConnection.GetMysqlPass()}"); }; strBuilder.AppendLine("-------------"); strBuilder.AppendLine("HQ Connection Settings"); try { DataAction.RunBugsHQ(() => action(ConnectionNames.BugsHQ), useConnectionStore: false); DataAction.RunCustomers(() => action(ConnectionNames.CustomersHQ), useConnectionStore: false); DataAction.RunManualPublisherHQ(() => action(ConnectionNames.ManualPublisher)); DataAction.RunWebChat(() => action(ConnectionNames.WebChat)); } catch (Exception ex) { strBuilder.AppendLine($"ERROR: {ex.Message}"); } strBuilder.AppendLine("-------------"); } MsgBoxCopyPaste msgbox = new MsgBoxCopyPaste(strBuilder.ToString()); msgbox.Text = Lans.g(this, "Diagnostics"); msgbox.ShowDialog(); }
///<summary>Inserts one BugSubmission into the database. Returns the new priKey. Doesn't use the cache.</summary> public static long InsertNoCache(BugSubmission bugSubmission) { return(InsertNoCache(bugSubmission, false)); }
private void FillOfficeInfoGrid(BugSubmission sub) { gridOfficeInfo.BeginUpdate(); gridOfficeInfo.ListGridRows.Clear(); if (sub == null) { gridOfficeInfo.EndUpdate(); return; } if (gridOfficeInfo.ListGridColumns.Count == 0) { gridOfficeInfo.ListGridColumns.Add(new GridColumn("Field", 130)); gridOfficeInfo.ListGridColumns.Add(new GridColumn("Value", 125)); } if (sub.IsMobileSubmission) { gridOfficeInfo.ListGridRows.Add(new GridRow("Mobile Fields", "") { ColorBackG = _colorGridHeaderBack, Bold = true, Tag = true }); gridOfficeInfo.ListGridRows.Add(new GridRow("AppTarget", sub.Info.AppTarget)); gridOfficeInfo.ListGridRows.Add(new GridRow("EConnectorVersion", sub.Info.EConnectorVersion)); gridOfficeInfo.ListGridRows.Add(new GridRow("AppVersion", sub.Info.AppVersion)); gridOfficeInfo.ListGridRows.Add(new GridRow("DevicePlatform", sub.Info.DevicePlatform)); gridOfficeInfo.ListGridRows.Add(new GridRow("DeviceModel", sub.Info.DeviceModel)); gridOfficeInfo.ListGridRows.Add(new GridRow("DeviceVersion", sub.Info.DeviceVersion)); gridOfficeInfo.ListGridRows.Add(new GridRow("DeviceManufacturer", sub.Info.DeviceManufacturer)); gridOfficeInfo.ListGridRows.Add(new GridRow("MWUserIdentifier", sub.Info.MWUserIdentifier.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("TimeSignalsLastReceived", sub.Info.TimeSignalsLastReceived.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("DeviceId", sub.Info.DeviceId)); } else { gridOfficeInfo.ListGridRows.Add(new GridRow("Preferences", "") { ColorBackG = _colorGridHeaderBack, Bold = true, Tag = true }); List <PrefName> listPrefNames = sub.Info.DictPrefValues.Keys.ToList(); foreach (PrefName prefName in listPrefNames) { GridRow row = new GridRow(); row.Cells.Add(prefName.ToString()); row.Cells.Add(sub.Info.DictPrefValues[prefName]); gridOfficeInfo.ListGridRows.Add(row); } gridOfficeInfo.ListGridRows.Add(new GridRow("Other", "") { ColorBackG = _colorGridHeaderBack, Bold = true, Tag = true }); gridOfficeInfo.ListGridRows.Add(new GridRow("CountClinics", sub.Info.CountClinics.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("EnabledPlugins", string.Join(",", sub.Info.EnabledPlugins?.Select(x => x).ToList() ?? new List <string>()))); gridOfficeInfo.ListGridRows.Add(new GridRow("ClinicNumCur", sub.Info.ClinicNumCur.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("UserNumCur", sub.Info.UserNumCur.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("PatientNumCur", sub.Info.PatientNumCur.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("ModuleNameCur", sub.Info.ModuleNameCur?.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("IsOfficeOnReplication", sub.Info.IsOfficeOnReplication.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("IsOfficeUsingMiddleTier", sub.Info.IsOfficeUsingMiddleTier.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("WindowsVersion", sub.Info.WindowsVersion?.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("CompName", sub.Info.CompName?.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("PreviousUpdateVersion", sub.Info.PreviousUpdateVersion)); gridOfficeInfo.ListGridRows.Add(new GridRow("PreviousUpdateTime", sub.Info.PreviousUpdateTime.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("ThreadName", sub.Info.ThreadName?.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("DatabaseName", sub.Info.DatabaseName?.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("ODBdllVersion", sub.Info.OpenDentBusinessVersion?.ToString())); gridOfficeInfo.ListGridRows.Add(new GridRow("ODBdllMTVersion", sub.Info.OpenDentBusinessMiddleTierVersion?.ToString() ?? "INVALID")); } #region Shared between mobile and proper gridOfficeInfo.ListGridRows.Add(new GridRow("ClinicNumCur", sub.Info.ClinicNumCur.ToString())); #endregion gridOfficeInfo.EndUpdate(); }
public static Bug AddBugAndJob(ODForm form, List <BugSubmission> listSelectedSubs, Patient pat) { if (!JobPermissions.IsAuthorized(JobPerm.Concept, true) && !JobPermissions.IsAuthorized(JobPerm.NotifyCustomer, true) && !JobPermissions.IsAuthorized(JobPerm.FeatureManager, true) && !JobPermissions.IsAuthorized(JobPerm.Documentation, true)) { return(null); } if (listSelectedSubs.Count == 0) { MsgBox.Show(form, "You must select a bug submission to create a job for."); return(null); } Job jobNew = new Job(); jobNew.Category = JobCategory.Bug; InputBox titleBox = new InputBox("Provide a brief title for the job."); if (titleBox.ShowDialog() != DialogResult.OK) { return(null); } if (String.IsNullOrEmpty(titleBox.textResult.Text)) { MsgBox.Show(form, "You must type a title to create a job."); return(null); } List <Def> listJobPriorities = Defs.GetDefsForCategory(DefCat.JobPriorities, true); if (listJobPriorities.Count == 0) { MsgBox.Show(form, "You have no priorities setup in definitions."); return(null); } jobNew.Title = titleBox.textResult.Text; long priorityNum = 0; priorityNum = listJobPriorities.FirstOrDefault(x => x.ItemValue.Contains("BugDefault")).DefNum; jobNew.Priority = priorityNum == 0?listJobPriorities.First().DefNum:priorityNum; jobNew.PhaseCur = JobPhase.Concept; jobNew.UserNumConcept = Security.CurUser.UserNum; Bug bugNew = new Bug(); bugNew = Bugs.GetNewBugForUser(); InputBox bugDescription = new InputBox("Provide a brief description for the bug. This will appear in the bug tracker.", jobNew.Title); if (bugDescription.ShowDialog() != DialogResult.OK) { return(null); } if (String.IsNullOrEmpty(bugDescription.textResult.Text)) { MsgBox.Show(form, "You must type a description to create a bug."); return(null); } FormVersionPrompt FormVP = new FormVersionPrompt("Enter versions found"); FormVP.ShowDialog(); if (FormVP.DialogResult != DialogResult.OK || string.IsNullOrEmpty(FormVP.VersionText)) { MsgBox.Show(form, "You must enter a version to create a bug."); return(null); } bugNew.Status_ = BugStatus.Accepted; bugNew.VersionsFound = FormVP.VersionText; bugNew.Description = bugDescription.textResult.Text; BugSubmission sub = listSelectedSubs.First(); jobNew.Requirements = BugSubmissions.GetSubmissionDescription(pat, sub); Jobs.Insert(jobNew); JobLink jobLinkNew = new JobLink(); jobLinkNew.LinkType = JobLinkType.Bug; jobLinkNew.JobNum = jobNew.JobNum; jobLinkNew.FKey = Bugs.Insert(bugNew); JobLinks.Insert(jobLinkNew); BugSubmissions.UpdateBugIds(bugNew.BugId, listSelectedSubs.Select(x => x.BugSubmissionNum).ToList()); if (MsgBox.Show(form, MsgBoxButtons.YesNo, "Would you like to create a task too?")) { long taskNum = CreateTask(pat, sub); if (taskNum != 0) { jobLinkNew = new JobLink(); jobLinkNew.LinkType = JobLinkType.Task; jobLinkNew.JobNum = jobNew.JobNum; jobLinkNew.FKey = taskNum; JobLinks.Insert(jobLinkNew); } } Signalods.SetInvalid(InvalidType.Jobs, KeyType.Job, jobNew.JobNum); FormOpenDental.S_GoToJob(jobNew.JobNum); return(bugNew); }
///<summary>When sub is set, fills customer group box with various information. ///When null, clears all fields.</summary> private void SetCustomerInfo(BugSubmission sub, bool isCustomerGridRefresh = true) { try { labelCustomerNum.Text = _patCur?.PatNum.ToString() ?? ""; labelRegKey.Text = sub.RegKey; labelCustomerState.Text = _patCur?.State ?? ""; labelCustomerPhone.Text = _patCur?.WkPhone ?? ""; labelSubNum.Text = POut.Long(sub.BugSubmissionNum); labelLastCall.Text = Commlogs.GetDateTimeOfLastEntryForPat(_patCur?.PatNum ?? 0).ToString(); } catch (Exception ex) { ex.DoNothing(); } butGoToAccount.Enabled = true; butBugTask.Enabled = true; butCompare.Enabled = true; if (!isCustomerGridRefresh || _groupSelection == -1 || _listSubs == null || !gridCustomerSubs.Visible) //Just in case checks. { return; } switch (_groupSelection) { case 0: #region None gridCustomerSubs.Title = "Customer Submissions"; gridCustomerSubs.BeginUpdate(); gridCustomerSubs.ListGridColumns.Clear(); gridCustomerSubs.ListGridColumns.Add(new GridColumn("Version", 100, HorizontalAlignment.Center)); gridCustomerSubs.ListGridColumns.Add(new GridColumn("Count", 50, HorizontalAlignment.Center)); gridCustomerSubs.ListGridRows.Clear(); Dictionary <string, List <BugSubmission> > dictCustomerSubVersions = _listSubs .Where(x => x.RegKey == sub.RegKey) .GroupBy(x => x.TryGetPrefValue(PrefName.ProgramVersion, "0.0.0.0")) .ToDictionary(x => x.Key, x => x.DistinctBy(y => y.ExceptionStackTrace).ToList()); foreach (KeyValuePair <string, List <BugSubmission> > pair in dictCustomerSubVersions) { gridCustomerSubs.ListGridRows.Add(new GridRow(pair.Key, pair.Value.Count.ToString())); } gridCustomerSubs.EndUpdate(); #endregion break; case 1: case 2: case 3: case 4: case 5: #region RegKey/Ver/Stack, Stacktrace, 95%, StackSig gridCustomerSubs.Title = "Grouped Subs (" + _listSubs.DistinctBy(x => x.RegKey).Count() + " Reg)"; if (_groupSelection.In(4, 5)) //StackSig,StackSimple { gridCustomerSubs.Title += " (" + _listSubs.DistinctBy(x => x.ExceptionStackTrace).Count() + " Stacks)"; } gridCustomerSubs.BeginUpdate(); gridCustomerSubs.ListGridColumns.Clear(); gridCustomerSubs.ListGridColumns.Add(new GridColumn("Vers.", 55, HorizontalAlignment.Center)); gridCustomerSubs.ListGridColumns.Add(new GridColumn("RegKey", 0, HorizontalAlignment.Center)); gridCustomerSubs.ListGridRows.Clear(); _listSubs.ForEach(x => { Patient rowPat; string patDescript = x.RegKey; if (_dictPatients.TryGetValue(x.RegKey, out rowPat)) { patDescript = rowPat.GetNameLF(); } GridRow row = new GridRow(x.TryGetPrefValue(PrefName.ProgramVersion, "0.0.0.0"), patDescript); row.Tag = x; gridCustomerSubs.ListGridRows.Add(row); }); gridCustomerSubs.EndUpdate(); #endregion break; } }
private void FillMainView(BugSubmission sub) { textStack.Text = sub.ExceptionStackTrace; textDevNote.Text = sub.DevNote; }
///<summary>When sub is set, fills customer group box with various information. ///When null, clears all fields.</summary> private void SetCustomerInfo(BugSubmission sub = null, bool refreshGrid = true) { if (sub == null) { textStack.Text = ""; //Also clear any submission specific fields. labelCustomerNum.Text = ""; labelCustomerName.Text = ""; labelCustomerState.Text = ""; labelCustomerPhone.Text = ""; labelSubNum.Text = ""; labelLastCall.Text = ""; FillOfficeInfoGrid(null); gridCustomerSubs.BeginUpdate(); gridCustomerSubs.Rows.Clear(); gridCustomerSubs.EndUpdate(); butGoToAccount.Enabled = false; butBugTask.Enabled = false; return; } try { if (_dictPatients.ContainsKey(sub.RegKey)) { _patCur = _dictPatients[sub.RegKey]; } else { RegistrationKey key = RegistrationKeys.GetByKey(sub.RegKey); _patCur = Patients.GetPat(key.PatNum); if (_patCur == null) { return; //Should not happen. } _dictPatients.Add(sub.RegKey, _patCur); } labelCustomerNum.Text = _patCur.PatNum.ToString(); labelCustomerName.Text = _patCur.GetNameLF(); labelCustomerState.Text = _patCur.State; labelCustomerPhone.Text = _patCur.WkPhone; labelSubNum.Text = POut.Long(sub.BugSubmissionNum); labelLastCall.Text = Commlogs.GetDateTimeOfLastEntryForPat(_patCur.PatNum).ToString(); } catch (Exception ex) { ex.DoNothing(); } if (!refreshGrid) { return; } switch (comboGrouping.SelectedIndex) { case 0: #region None gridCustomerSubs.Title = "Customer Submissions"; gridCustomerSubs.BeginUpdate(); gridCustomerSubs.Columns.Clear(); gridCustomerSubs.Columns.Add(new ODGridColumn("Version", 100, HorizontalAlignment.Center)); gridCustomerSubs.Columns.Add(new ODGridColumn("Count", 50, HorizontalAlignment.Center)); gridCustomerSubs.Rows.Clear(); Dictionary <string, List <BugSubmission> > dictCustomerSubVersions = _listAllSubs .Where(x => x.RegKey == sub.RegKey) .GroupBy(x => x.Info.DictPrefValues[PrefName.ProgramVersion]) .ToDictionary(x => x.Key, x => x.DistinctBy(y => y.ExceptionStackTrace).ToList()); foreach (KeyValuePair <string, List <BugSubmission> > pair in dictCustomerSubVersions) { gridCustomerSubs.Rows.Add(new ODGridRow(pair.Key, pair.Value.Count.ToString())); } gridCustomerSubs.EndUpdate(); #endregion break; case 1: case 2: case 3: #region Customer, Stacktrace, 95% List <BugSubmission> listSubGroup = ((List <BugSubmission>)gridSubs.Rows[gridSubs.GetSelectedIndex()].Tag); gridCustomerSubs.Title = "Grouped Submissions"; gridCustomerSubs.BeginUpdate(); gridCustomerSubs.Columns.Clear(); gridCustomerSubs.Columns.Add(new ODGridColumn("Vers.", 55, HorizontalAlignment.Center)); gridCustomerSubs.Columns.Add(new ODGridColumn("RegKey", 140, HorizontalAlignment.Center)); gridCustomerSubs.Rows.Clear(); listSubGroup.ForEach(x => { ODGridRow row = new ODGridRow(x.Info.DictPrefValues[PrefName.ProgramVersion], x.RegKey); row.Tag = x; gridCustomerSubs.Rows.Add(row); }); gridCustomerSubs.EndUpdate(); #endregion break; } butGoToAccount.Enabled = true; butBugTask.Enabled = true; }
private void FormBugSubmissions_Load(object sender, EventArgs e) { switch (_viewMode) { case FormBugSubmissionMode.AddBug: dateRangePicker.SetDateTimeFrom(DateTime.Today.AddDays(-60)); dateRangePicker.SetDateTimeTo(DateTime.Today); break; case FormBugSubmissionMode.ViewOnly: dateRangePicker.SetDateTimeFrom(DateTime.MinValue); dateRangePicker.SetDateTimeTo(DateTime.MaxValue.AddDays(-1)); //Subtract a day for DbHelper.DateTConditionColumn(...) butAddJob.Visible = false; checkShowAttached.Checked = true; break; case FormBugSubmissionMode.SelectionMode: dateRangePicker.SetDateTimeFrom(DateTime.MinValue); dateRangePicker.SetDateTimeTo(DateTime.MaxValue.AddDays(-1)); //Subtract a day for DbHelper.DateTConditionColumn(...) butAddJob.Text = "OK"; //On click the selected rows are saved and this form will close. break; case FormBugSubmissionMode.ValidationMode: dateRangePicker.SetDateTimeFrom(DateTime.MinValue); dateRangePicker.SetDateTimeTo(DateTime.MaxValue.AddDays(-1)); //Subtract a day for DbHelper.DateTConditionColumn(...) butAddJob.Text = "OK"; checkShowAttached.Checked = true; groupFilters.Enabled = false; break; } bugSubmissionControl.TextDevNoteLeave += textDevNote_PostLeave; #region comboGrouping comboGrouping.Items.Add("None"); comboGrouping.Items.Add("RegKey/Ver/Stack"); comboGrouping.Items.Add("StackTrace"); comboGrouping.Items.Add("95%"); switch (_viewMode) { case FormBugSubmissionMode.AddBug: comboGrouping.SelectedIndex = 2; //Default to StackTrace. break; case FormBugSubmissionMode.SelectionMode: case FormBugSubmissionMode.ValidationMode: case FormBugSubmissionMode.ViewOnly: comboGrouping.SelectedIndex = 0; //Default to None. break; } #endregion #region comboSortBy comboSortBy.Items.Add("Vers./Count"); comboSortBy.SelectedIndex = 0; //Default to Vers./Count #endregion #region Right Click Menu ContextMenu gridSubMenu = new ContextMenu(); Menu.MenuItemCollection menuItemCollection = new Menu.MenuItemCollection(gridSubMenu); List <MenuItem> listMenuItems = new List <MenuItem>(); listMenuItems.Add(new MenuItem(Lan.g(this, "Open Submission"), new EventHandler(gridClaimDetails_RightClickHelper))); listMenuItems.Add(new MenuItem(Lan.g(this, "Open Bug"), new EventHandler(gridClaimDetails_RightClickHelper))); //Enabled by default menuItemCollection.AddRange(listMenuItems.ToArray()); gridSubMenu.Popup += new EventHandler((o, ea) => { int index = gridSubs.GetSelectedIndex(); bool isOpenSubEnabled = false; bool isOpenBugEnabled = false; if (index != -1 && gridSubs.SelectedIndices.Count() == 1) { BugSubmission bugSub = ((List <BugSubmission>)gridSubs.Rows[index].Tag).First(); isOpenSubEnabled = true; isOpenBugEnabled = (bugSub.BugId != 0); } gridSubMenu.MenuItems[0].Enabled = isOpenSubEnabled; //Open Submission gridSubMenu.MenuItems[1].Enabled = isOpenBugEnabled; //Open Bug }); gridSubs.ContextMenu = gridSubMenu; #endregion FillSubGrid(true); }
private int GetGroupCount(BugSubmission sub) { return((sub.TagOD as List <BugSubmission>).Count); }