private void FillGrid() { this.Cursor = Cursors.WaitCursor; _listPatients = Patients.GetLimForPats(_listAppts.Select(x => x.PatNum).Distinct().ToList()); gridConflicts.BeginUpdate(); gridConflicts.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableApptConflicts", "Patient"), 140); gridConflicts.Columns.Add(col); col = new ODGridColumn(Lan.g("TableApptConflicts", "Date"), 120); gridConflicts.Columns.Add(col); col = new ODGridColumn(Lan.g("TableApptConflicts", "Op"), 110); gridConflicts.Columns.Add(col); col = new ODGridColumn(Lan.g("TableApptConflicts", "Prov"), 50); gridConflicts.Columns.Add(col); col = new ODGridColumn(Lan.g("TableApptConflicts", "Procedures"), 150); gridConflicts.Columns.Add(col); col = new ODGridColumn(Lan.g("TableApptConflicts", "Notes"), 200); gridConflicts.Columns.Add(col); gridConflicts.Rows.Clear(); ODGridRow row; foreach (Appointment apptCur in _listAppts) { row = new ODGridRow(); Patient patCur = _listPatients.First(x => x.PatNum == apptCur.PatNum); row.Cells.Add(patCur.GetNameLF()); if (apptCur.AptDateTime.Year < 1880) //shouldn't be possible. { row.Cells.Add(""); } else { row.Cells.Add(apptCur.AptDateTime.ToShortDateString() + " " + apptCur.AptDateTime.ToShortTimeString()); } row.Cells.Add(Operatories.GetAbbrev(apptCur.Op)); if (apptCur.IsHygiene) { row.Cells.Add(Providers.GetAbbr(apptCur.ProvHyg)); } else { row.Cells.Add(Providers.GetAbbr(apptCur.ProvNum)); } row.Cells.Add(apptCur.ProcDescript); row.Cells.Add(apptCur.Note); row.Tag = apptCur; gridConflicts.Rows.Add(row); } gridConflicts.EndUpdate(); Cursor = Cursors.Default; }
private void FillGrid() { //do not refresh from db SchedList.Sort(CompareSchedule); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableSchedDay", "Provider"), 100); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSchedDay", "Employee"), 100); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSchedDay", "Start Time"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSchedDay", "Stop Time"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSchedDay", "Ops"), 150); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSchedDay", "Note"), 100); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; string note; string opdesc; //string opstr; //string[] oparray; for (int i = 0; i < SchedList.Count; i++) { row = new ODGridRow(); //Prov if (SchedList[i].ProvNum != 0) { row.Cells.Add(Providers.GetAbbr(SchedList[i].ProvNum)); } else { row.Cells.Add(""); } //Employee if (SchedList[i].EmployeeNum == 0) { row.Cells.Add(""); } else { row.Cells.Add(Employees.GetEmp(SchedList[i].EmployeeNum).FName); } //times if (SchedList[i].StartTime == TimeSpan.Zero && SchedList[i].StopTime == TimeSpan.Zero) //SchedList[i].SchedType==ScheduleType.Practice){ { row.Cells.Add(""); row.Cells.Add(""); } else { row.Cells.Add(SchedList[i].StartTime.ToShortTimeString()); row.Cells.Add(SchedList[i].StopTime.ToShortTimeString()); } //ops opdesc = ""; for (int o = 0; o < SchedList[i].Ops.Count; o++) { if (o > 0) { opdesc += ","; } opdesc += Operatories.GetAbbrev(SchedList[i].Ops[o]); } row.Cells.Add(opdesc); //note note = ""; if (SchedList[i].Status == SchedStatus.Holiday) { note += Lan.g(this, "Holiday: "); } note += SchedList[i].Note; row.Cells.Add(note); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }