private void butAdd_Click(object sender, EventArgs e) { if (_viewMode == FormBugSubmissionMode.SelectionMode) //Text is set to "Ok" when SelectionMode { ListSelectedSubs = gridSubs.SelectedIndices.SelectMany(x => (List <BugSubmission>)gridSubs.ListGridRows[x].Tag).ToList(); DialogResult = DialogResult.OK; return; } if (_viewMode == FormBugSubmissionMode.ValidationMode) //Text is set to "Ok" when SelectionMode { ListSelectedSubs = _listAllSubs; DialogResult = DialogResult.OK; return; } if (butAddJob.Text == "View Job" && butAddJob.Tag is JobLink) //Assocaited to job, see gridSubs_CellClick(...) { FormOpenDental.S_GoToJob((butAddJob.Tag as JobLink).JobNum); return; } List <BugSubmission> listSelectedSubs = gridSubs.SelectedIndices.SelectMany(x => (List <BugSubmission>)gridSubs.ListGridRows[x].Tag).ToList(); BugCur = BugSubmissionL.AddBugAndJob(this, listSelectedSubs, _patCur); if (BugCur == null) { return; } if (this.Modal) { this.DialogResult = DialogResult.OK; } else { FillSubGrid(true); } }
private void butAddViewJob_Click(object sender, EventArgs e) { if (_patCur == null) { return; } if (_listLinks.Count > 0) //View Job { if (_listLinks.Count == 1) { JobLink link = _listLinks.First(); FormOpenDental.S_GoToJob(link.JobNum); } else { MsgBox.Show(this, "Submission is associated to multiple jobs"); } return; } _bug = BugSubmissionL.AddBugAndJob(this, new List <BugSubmission>() { _subCur }, _patCur); if (_bug == null) { return; } if (this.Modal) { DialogResult = DialogResult.OK; } }
private void gridNoHours_CellDoubleClick(object sender, ODGridClickEventArgs e) { FormOpenDental.S_GoToJob(((Job)gridNoHours.Rows[e.Row].Tag).JobNum); }
private void gridQuoteOld_CellDoubleClick(object sender, ODGridClickEventArgs e) { FormOpenDental.S_GoToJob(((Job)gridQuoteNotStarted.Rows[e.Row].Tag).JobNum); }
private void dataJobs_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { FormOpenDental.S_GoToJob(((Job)(dataJobs.Rows[e.RowIndex].Tag)).JobNum); }
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); }
private void butJob3_Click(object sender, EventArgs e) { FormOpenDental.S_GoToJob(_listTopJobs[2].Item1); }
private void gridCalculatedJobs_CellDoubleClick(object sender, ODGridClickEventArgs e) { FormOpenDental.S_GoToJob(((Job)gridCalculatedJobs.ListGridRows[e.Row].Tag).JobNum); }