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 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 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.Rows[x].Tag).ToList(); DialogResult = DialogResult.OK; return; } if (_viewMode == FormBugSubmissionMode.ValidationMode) //Text is set to "Ok" when SelectionMode { ListSelectedSubs = _listAllSubs; DialogResult = DialogResult.OK; return; } List <BugSubmission> listSelectedSubs = gridSubs.SelectedIndices.SelectMany(x => (List <BugSubmission>)gridSubs.Rows[x].Tag).ToList(); BugCur = BugSubmissionL.AddBugAndJob(this, listSelectedSubs, _patCur); if (BugCur == null) { return; } if (this.Modal) { this.DialogResult = DialogResult.OK; } else { FillSubGrid(true); } }