private void butUp_Click(object sender, EventArgs e) { if (gridMain.SelectedIndices.Length == 0) { MsgBox.Show(this, "Please select a clinic first."); return; } //Already at the top of the list if (gridMain.GetSelectedIndex() == 0) { return; } int selectedIdx = gridMain.GetSelectedIndex(); //Swap clinic ItemOrders Clinic sourceClin = ((Clinic)gridMain.Rows[selectedIdx].Tag); Clinic destClin = ((Clinic)gridMain.Rows[selectedIdx - 1].Tag); int sourceOrder = sourceClin.ItemOrder; sourceClin.ItemOrder = destClin.ItemOrder; destClin.ItemOrder = sourceOrder; //Move selected clinic up ListClinics.Sort(ClinicSort); FillGrid(); //Reselect the clinic that was moved gridMain.SetSelected(selectedIdx - 1, true); gridMain.SetSelected(selectedIdx, false); }
private void gridMain_CellDoubleClick(object sender, UI.ODGridClickEventArgs e) { FormScreenGroupEdit FormSG = new FormScreenGroupEdit(_listScreenGroups[gridMain.GetSelectedIndex()]); FormSG.ShowDialog(); FillGrid(); }
private void butUp_Click(object sender, EventArgs e) { if (gridMain.SelectedIndices.Length == 0) { MsgBox.Show(this, "Please select a clinic first."); return; } int selectedIdx = gridMain.GetSelectedIndex(); //Already at the top of the list or the clinic just below the HQ 'clinic' is selected, moving up does nothing if (selectedIdx == 0 || (IncludeHQInList && selectedIdx == 1)) { return; } //Swap clinic ItemOrders Clinic sourceClin = ((Clinic)gridMain.ListGridRows[selectedIdx].Tag); Clinic destClin = ((Clinic)gridMain.ListGridRows[selectedIdx - 1].Tag); if (sourceClin.ItemOrder == destClin.ItemOrder) { sourceClin.ItemOrder--; } else { int sourceOrder = sourceClin.ItemOrder; sourceClin.ItemOrder = destClin.ItemOrder; destClin.ItemOrder = sourceOrder; } //Move selected clinic up ListClinics.Sort(ClinicSort); FillGrid(); }
private void FillGrid(bool refreshList = true, bool isScrollToSelection = true) { if (refreshList) { _listQueries = UserQueries.GetDeepCopy(); } string[] strSearchTerms = Regex.Split(textSearch.Text, @"\W"); //matches any non-word character //get all queries that contain ALL of the search terms entered, either in the query text or the query description. List <UserQuery> listDisplayQueries = _listQueries .Where(x => strSearchTerms.All(y => x.QueryText.ToLowerInvariant().Contains(y.ToLowerInvariant()) || x.Description.ToLowerInvariant().Contains(y.ToLowerInvariant()) )).ToList(); //attempt to preserve the currently selected query. long selectedQueryNum = 0; if (gridMain.GetSelectedIndex() != -1) { selectedQueryNum = gridMain.SelectedTag <UserQuery>().QueryNum; } gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); gridMain.ListGridColumns.Add(new GridColumn(Lan.g(gridMain.TranslationName, "Query"), 350)); if (Security.IsAuthorized(Permissions.UserQueryAdmin, true)) { gridMain.ListGridColumns.Add(new GridColumn(Lan.g(gridMain.TranslationName, "Released"), 55, HorizontalAlignment.Center)); } gridMain.ListGridRows.Clear(); foreach (UserQuery queryCur in listDisplayQueries) { if (!Security.IsAuthorized(Permissions.UserQueryAdmin, true) && !queryCur.IsReleased) { continue; //non-released queries only appear for people with UserQueryAdmin permission. } GridRow row = new GridRow(); row.Cells.Add(queryCur.Description); if (Security.IsAuthorized(Permissions.UserQueryAdmin, true)) { row.Cells.Add(queryCur.IsReleased ? "X" : ""); } row.Tag = queryCur; gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); int selectedIdx = gridMain.ListGridRows.Select(x => (UserQuery)x.Tag).ToList().FindIndex(y => y.QueryNum == selectedQueryNum); if (selectedIdx > -1) { gridMain.SetSelected(selectedIdx, true); } if (gridMain.GetSelectedIndex() == -1) { gridMain.SetSelected(0, true); //can handle values outside of the row count (so if there are no rows, this will not fail) } if (isScrollToSelection) { gridMain.ScrollToIndex(gridMain.GetSelectedIndex()); //can handle values outside of the row count } RefreshQueryCur(); }
///<summary>Copy an internal form over to a new custom form.</summary> private void butCopy_Click(object sender, EventArgs e) { if (gridInternal.GetSelectedIndex() == -1) { MessageBox.Show(Lan.g(this, "Please select an item from the internal grid to copy over to the custom grid.")); return; } //just insert it into the db. ClaimForm claimFormInternal = (ClaimForm)gridInternal.Rows[gridInternal.GetSelectedIndex()].Tag; long claimFormNum = ClaimForms.Insert(claimFormInternal, true); FillGridCustom(); }
private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e) { if (gridMain.GetSelectedIndex() == -1) { //this should never happen return; } RxPat rx = _listRx[gridMain.GetSelectedIndex()]; FormRxEdit FormRxE = new FormRxEdit(_patCur, rx); FormRxE.ShowDialog(); if (FormRxE.DialogResult != DialogResult.OK) { return; } FillGrid(); }
private void FillGrid() { long previousSelected = -1; if (gridMain.GetSelectedIndex() != -1) { previousSelected = _listSchoolCourses[gridMain.GetSelectedIndex()].SchoolCourseNum; } SchoolCourses.RefreshCache(); gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col = new GridColumn(Lan.g("FormSchoolCourses", "Course ID"), 100); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormEvaluationDefEdit", "Description"), 80); gridMain.ListGridColumns.Add(col); gridMain.ListGridRows.Clear(); GridRow row; for (int i = 0; i < _listSchoolCourses.Count; i++) { row = new GridRow(); row.Cells.Add(_listSchoolCourses[i].CourseID); row.Cells.Add(_listSchoolCourses[i].Descript); gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); }
///<summary>Delete an unusued custom claim form.</summary> private void butDelete_Click(object sender, System.EventArgs e) { if (gridCustom.GetSelectedIndex() == -1) { MessageBox.Show(Lan.g(this, "Please select a Custom Claim Form first.")); return; } ClaimForm claimFormCur = (ClaimForm)gridCustom.Rows[gridCustom.GetSelectedIndex()].Tag; if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete custom claim form?")) { return; } if (!ClaimForms.Delete(claimFormCur)) { MsgBox.Show(this, "Claim form is already in use."); return; } changed = true; FillGridCustom(); }
private void butDefaultDental_Click(object sender, EventArgs e) { if (gridMain.GetSelectedIndex() == -1) { MsgBox.Show(this, "Please select a row first."); return; } Clearinghouse ch = _listClearinghousesHq[gridMain.GetSelectedIndex()]; if (ch.Eformat == ElectronicClaimFormat.x837_5010_med_inst) //med/inst clearinghouse { MsgBox.Show(this, "The selected clearinghouse must first be set to a dental e-claim format."); return; } bool isInvalid = false; if (!CultureInfo.CurrentCulture.Name.EndsWith("CA") && PrefC.GetLong(PrefName.ClearinghouseDefaultEligibility) == 0 && Prefs.UpdateLong(PrefName.ClearinghouseDefaultEligibility, ch.ClearinghouseNum)) { isInvalid = true; } if (Prefs.UpdateLong(PrefName.ClearinghouseDefaultDent, ch.ClearinghouseNum)) { isInvalid = true; } if (isInvalid) { DataValid.SetInvalid(InvalidType.Prefs); } FillGrid(); }
private void FillMain() { int selectedIdx = gridMain.GetSelectedIndex(); gridMain.BeginUpdate(); gridMain.Columns.Clear(); gridMain.Columns.Add(new ODGridColumn("Abbr", 75)); gridMain.Columns.Add(new ODGridColumn("Note", 600)); gridMain.Rows.Clear(); if (listCat.SelectedIndex == -1) { gridMain.EndUpdate(); return; } ODGridRow row; foreach (QuickPasteNote note in _listNotes) { if (note.QuickPasteCatNum != _listCats[listCat.SelectedIndex].QuickPasteCatNum) { continue; } row = new ODGridRow(); row.Cells.Add(string.IsNullOrWhiteSpace(note.Abbreviation)?"":"?" + note.Abbreviation); row.Cells.Add(note.Note.Replace("\r", "").Replace("\n", "").Left(120, true)); row.Tag = note; gridMain.Rows.Add(row); } gridMain.EndUpdate(); if (selectedIdx == -1) //Select the last option. { gridMain.SetSelected(gridMain.Rows.Count - 1, true); gridMain.ScrollToEnd(); } else if (selectedIdx < gridMain.Rows.Count) //Select the previously selected position. { gridMain.SetSelected(selectedIdx, true); } }
private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e) { if (gridMain.GetSelectedIndex() == -1) { return; } SelectedPayPlanNum = (long)gridMain.ListGridRows[gridMain.GetSelectedIndex()].Tag; DialogResult = DialogResult.OK; }
private void FillGrid() { long previousSelectedStateAbbrNum = -1; int newSelectedIdx = -1; if (gridMain.GetSelectedIndex() != -1) { previousSelectedStateAbbrNum = ((StateAbbr)gridMain.ListGridRows[gridMain.GetSelectedIndex()].Tag).StateAbbrNum; } gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col = new GridColumn(Lan.g("FormStateAbbrs", "Description"), 175); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormStateAbbrs", "Abbr"), 70); gridMain.ListGridColumns.Add(col); if (PrefC.GetBool(PrefName.EnforceMedicaidIDLength)) { col = new GridColumn(Lan.g("FormStateAbbrs", "Medicaid ID Length"), 200); gridMain.ListGridColumns.Add(col); } gridMain.ListGridRows.Clear(); GridRow row; List <StateAbbr> stateAbbrs = StateAbbrs.GetDeepCopy(); for (int i = 0; i < stateAbbrs.Count; i++) { row = new GridRow(); row.Cells.Add(stateAbbrs[i].Description); row.Cells.Add(stateAbbrs[i].Abbr); if (PrefC.GetBool(PrefName.EnforceMedicaidIDLength)) { if (stateAbbrs[i].MedicaidIDLength == 0) { row.Cells.Add(""); } else { row.Cells.Add(stateAbbrs[i].MedicaidIDLength.ToString()); } } row.Tag = stateAbbrs[i]; gridMain.ListGridRows.Add(row); if (stateAbbrs[i].StateAbbrNum == previousSelectedStateAbbrNum) { newSelectedIdx = i; } } gridMain.EndUpdate(); gridMain.SetSelected(newSelectedIdx, true); }
private void FillTable() { Referrals.RefreshCache(); listRef = Referrals.GetDeepCopy(); if (!checkHidden.Checked) { listRef.RemoveAll(x => x.IsHidden); } if (!checkShowPat.Checked) { listRef.RemoveAll(x => x.PatNum > 0); } if (!checkShowDoctor.Checked) { listRef.RemoveAll(x => x.IsDoctor); } if (!checkShowOther.Checked) { listRef.RemoveAll(x => x.PatNum == 0 && !x.IsDoctor); } if (checkPreferred.Checked) { listRef.RemoveAll(x => !x.IsPreferred); } if (!string.IsNullOrWhiteSpace(textSearch.Text)) { string[] searchTokens = textSearch.Text.ToLower().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); listRef.RemoveAll(x => searchTokens.Any(y => !x.FName.ToLower().Contains(y) && !x.LName.ToLower().Contains(y))); } int scrollValue = gridMain.ScrollValue; long selectedRefNum = -1; if (gridMain.GetSelectedIndex() > -1) { selectedRefNum = ((Referral)gridMain.Rows[gridMain.GetSelectedIndex()].Tag).ReferralNum; } gridMain.BeginUpdate(); gridMain.Columns.Clear(); gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "LastName"), 150)); gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "FirstName"), 80)); gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "MI"), 30)); gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "Title"), 70)); gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "Specialty"), 60)); gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "Patient"), 45)); gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "Note"), 250)); gridMain.Rows.Clear(); ODGridRow row; int indexSelectedRef = -1; foreach (Referral refCur in listRef) { row = new ODGridRow(); row.Cells.Add(refCur.LName); row.Cells.Add(refCur.FName); row.Cells.Add(refCur.MName.Left(1).ToUpper()); //Left(1) will return empty string if MName is null or empty string, so ToUpper is null safe row.Cells.Add(refCur.Title); row.Cells.Add(refCur.IsDoctor?Lan.g("enumDentalSpecialty", Defs.GetName(DefCat.ProviderSpecialties, refCur.Specialty)):""); row.Cells.Add(refCur.PatNum > 0?"X":""); row.Cells.Add(refCur.Note); if (refCur.IsHidden) { row.ColorText = Color.Gray; } row.Tag = refCur; gridMain.Rows.Add(row); if (refCur.ReferralNum == selectedRefNum) { indexSelectedRef = gridMain.Rows.Count - 1; } } gridMain.EndUpdate(); if (indexSelectedRef > -1) { gridMain.SetSelected(indexSelectedRef, true); } gridMain.ScrollValue = scrollValue; labelResultCount.Text = gridMain.Rows.Count.ToString() + Lan.g(this, " results found"); }
private void gridProgram_CellDoubleClick(object sender, ODGridClickEventArgs e) { DialogResult dResult = DialogResult.None; Program program = _listPrograms[gridProgram.GetSelectedIndex()].Copy(); switch (program.ProgName) { case "UAppoint": FormUAppoint FormU = new FormUAppoint(); FormU.ProgramCur = program; dResult = FormU.ShowDialog(); break; case "eClinicalWorks": if (!Security.IsAuthorized(Permissions.SecurityAdmin)) { break; } FormEClinicalWorks FormECW = new FormEClinicalWorks(); FormECW.ProgramCur = program; dResult = FormECW.ShowDialog(); break; case "eRx": FormErxSetup FormES = new FormErxSetup(); dResult = FormES.ShowDialog(); break; case "Mountainside": FormMountainside FormM = new FormMountainside(); FormM.ProgramCur = program; dResult = FormM.ShowDialog(); break; case "PayConnect": FormPayConnectSetup fpcs = new FormPayConnectSetup(); dResult = fpcs.ShowDialog(); break; case "Podium": FormPodiumSetup FormPS = new FormPodiumSetup(); dResult = FormPS.ShowDialog(); break; case "Xcharge": FormXchargeSetup fxcs = new FormXchargeSetup(); dResult = fxcs.ShowDialog(); break; case "FHIR": FormFHIRSetup FormFS = new FormFHIRSetup(); dResult = FormFS.ShowDialog(); break; case "Transworld": FormTransworldSetup FormTs = new FormTransworldSetup(); dResult = FormTs.ShowDialog(); break; case "PaySimple": FormPaySimpleSetup formPS = new FormPaySimpleSetup(); dResult = formPS.ShowDialog(); break; default: FormProgramLinkEdit FormPE = new FormProgramLinkEdit(); if (Programs.IsStatic(program)) { FormPE.AllowToolbarChanges = false; } FormPE.ProgramCur = program; dResult = FormPE.ShowDialog(); break; } if (dResult == DialogResult.OK) { changed = true; FillList(); } }
private void FillTable() { Referrals.RefreshCache(); listRef = new List <Referral>(); for (int i = 0; i < Referrals.List.Length; i++) { if (!checkHidden.Checked) //don't include hidden { if (Referrals.List[i].IsHidden) //if hidden { continue; } } if (textSearch.Text != "") { if (!Referrals.List[i].LName.ToLower().StartsWith(textSearch.Text.ToLower())) //no match { continue; } } listRef.Add(Referrals.List[i]); } int scrollValue = gridMain.ScrollValue; long selectedRefNum = -1; if (gridMain.GetSelectedIndex() != -1) { selectedRefNum = ((Referral)gridMain.Rows[gridMain.GetSelectedIndex()].Tag).ReferralNum; } gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lans.g("TableSelectRefferal", "LastName"), 150); gridMain.Columns.Add(col); col = new ODGridColumn(Lans.g("TableSelectRefferal", "FirstName"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lans.g("TableSelectRefferal", "MI"), 30); gridMain.Columns.Add(col); col = new ODGridColumn(Lans.g("TableSelectRefferal", "Title"), 70); gridMain.Columns.Add(col); col = new ODGridColumn(Lans.g("TableSelectRefferal", "Specialty"), 60); gridMain.Columns.Add(col); col = new ODGridColumn(Lans.g("TableSelectRefferal", "Patient"), 45); gridMain.Columns.Add(col); col = new ODGridColumn(Lans.g("TableSelectRefferal", "Note"), 250); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < listRef.Count; i++) { row = new ODGridRow(); row.Cells.Add(listRef[i].LName); row.Cells.Add(listRef[i].FName); if (listRef[i].MName != "") { row.Cells.Add(listRef[i].MName.Substring(0, 1).ToUpper()); } else { row.Cells.Add(""); } row.Cells.Add(listRef[i].Title); if (listRef[i].IsDoctor) { row.Cells.Add(Lan.g("enumDentalSpecialty", ((DentalSpecialty)(listRef[i].Specialty)).ToString())); } else { row.Cells.Add(""); } if (listRef[i].PatNum > 0) { row.Cells.Add("X"); } else { row.Cells.Add(""); } row.Cells.Add(listRef[i].Note); if (listRef[i].IsHidden) { row.ColorText = Color.Gray; } row.Tag = listRef[i]; gridMain.Rows.Add(row); } gridMain.EndUpdate(); labelResultCount.Text = gridMain.Rows.Count.ToString() + " results found."; gridMain.ScrollValue = scrollValue; for (int i = 0; i < gridMain.Rows.Count; i++) { if (((Referral)gridMain.Rows[i].Tag).ReferralNum == selectedRefNum) { gridMain.SetSelected(i, true); break; } } }