private void FillGridWebSchedNewPatApptOps() { int opNameWidth = 150; int clinicWidth = 150; if (!PrefC.HasClinicsEnabled) { opNameWidth += clinicWidth; } gridWebSchedNewPatApptOps.BeginUpdate(); gridWebSchedNewPatApptOps.ListGridColumns.Clear(); gridWebSchedNewPatApptOps.ListGridColumns.Add(new GridColumn(Lan.g("FormEServicesSetup", "Op Name"), opNameWidth)); gridWebSchedNewPatApptOps.ListGridColumns.Add(new GridColumn(Lan.g("FormEServicesSetup", "Abbrev"), 60)); if (PrefC.HasClinicsEnabled) { gridWebSchedNewPatApptOps.ListGridColumns.Add(new GridColumn(Lan.g("FormEServicesSetup", "Clinic"), clinicWidth)); } gridWebSchedNewPatApptOps.ListGridColumns.Add(new GridColumn(Lan.g("FormEServicesSetup", "Provider"), 60)); gridWebSchedNewPatApptOps.ListGridColumns.Add(new GridColumn(Lan.g("FormEServicesSetup", "Hygienist"), 60)); gridWebSchedNewPatApptOps.ListGridColumns.Add(new GridColumn(Lan.g("FormEServicesSetup", "ApptTypes"), 0)); gridWebSchedNewPatApptOps.ListGridRows.Clear(); //A list of all operatories that are considered for web sched new pat appt. List <Operatory> listWSNPAOps = Operatories.GetOpsForWebSchedNewPatAppts(); List <long> listWSNPADefNums = listWSNPAOps.SelectMany(x => x.ListWSNPAOperatoryDefNums).Distinct().ToList(); List <Def> listWSNPADefs = Defs.GetDefs(DefCat.WebSchedNewPatApptTypes, listWSNPADefNums); GridRow row; foreach (Operatory op in listWSNPAOps) { row = new GridRow(); row.Cells.Add(op.OpName); row.Cells.Add(op.Abbrev); if (PrefC.HasClinicsEnabled) { row.Cells.Add(Clinics.GetAbbr(op.ClinicNum)); } row.Cells.Add(Providers.GetAbbr(op.ProvDentist)); row.Cells.Add(Providers.GetAbbr(op.ProvHygienist)); //Display the name of all "appointment types" (definition.ItemName) that are associated with the current operatory. row.Cells.Add(string.Join(", ", listWSNPADefs.Where(x => op.ListWSNPAOperatoryDefNums.Any(y => y == x.DefNum)).Select(x => x.ItemName))); row.Tag = op; gridWebSchedNewPatApptOps.ListGridRows.Add(row); } gridWebSchedNewPatApptOps.EndUpdate(); }
private void FillGrid() { gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); int opNameWidth = 180; int clinicWidth = 85; if (!PrefC.HasClinicsEnabled) { //Clinics are hidden so add the width of the clinic column to the Op Name column because the clinic column will not show. opNameWidth += clinicWidth; } GridColumn col = new GridColumn(Lan.g("TableOperatories", "Op Name"), opNameWidth); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableOperatories", "Abbrev"), 70); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableOperatories", "IsHidden"), 64, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); if (PrefC.HasClinicsEnabled) { col = new GridColumn(Lan.g("TableOperatories", "Clinic"), clinicWidth); gridMain.ListGridColumns.Add(col); } col = new GridColumn(Lan.g("TableOperatories", "Provider"), 70); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableOperatories", "Hygienist"), 70); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableOperatories", "IsHygiene"), 64, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableOperatories", "IsWebSched"), 74, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableOperatories", "IsNewPat"), 0, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); gridMain.ListGridRows.Clear(); GridRow row; List <long> listWSNPAOperatoryNums = Operatories.GetOpsForWebSchedNewPatAppts().Select(x => x.OperatoryNum).ToList(); foreach (Operatory opCur in _listOps) { row = new GridRow(); row.Cells.Add(opCur.OpName); row.Cells.Add(opCur.Abbrev); if (opCur.IsHidden) { row.Cells.Add("X"); } else { row.Cells.Add(""); } if (PrefC.HasClinicsEnabled) { row.Cells.Add(Clinics.GetAbbr(opCur.ClinicNum)); } row.Cells.Add(Providers.GetAbbr(opCur.ProvDentist)); row.Cells.Add(Providers.GetAbbr(opCur.ProvHygienist)); if (opCur.IsHygiene) { row.Cells.Add("X"); } else { row.Cells.Add(""); } row.Cells.Add(opCur.IsWebSched?"X":""); row.Cells.Add(listWSNPAOperatoryNums.Contains(opCur.OperatoryNum) ? "X" : ""); row.Tag = opCur; gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); }