Beispiel #1
0
        private void FillGrid()
        {
            labCaseList = LabCases.GetForPat(PatNum, IsPlanned);
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableLabCaseSelect", "Date Created"), 80);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableLabCaseSelect", "Lab"), 100);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableLabCaseSelect", "Phone"), 100);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableLabCaseSelect", "Instructions"), 200);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow  row;
            DateTime   dateCreated;
            Laboratory lab;

            for (int i = 0; i < labCaseList.Count; i++)
            {
                row         = new ODGridRow();
                dateCreated = labCaseList[i].DateTimeCreated;
                row.Cells.Add(dateCreated.ToString("ddd") + " " + dateCreated.ToShortDateString() + " " + dateCreated.ToShortTimeString());
                lab = Laboratories.GetOne(labCaseList[i].LaboratoryNum);
                row.Cells.Add(lab.Description);
                row.Cells.Add(lab.Phone);
                row.Cells.Add(labCaseList[i].Instructions);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Beispiel #2
0
        private void FillGrid()
        {
            labCaseList = LabCases.GetForPat(PatNum, IsPlanned);
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g("TableLabCaseSelect", "Date Created"), 80);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableLabCaseSelect", "Lab"), 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableLabCaseSelect", "Phone"), 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableLabCaseSelect", "Instructions"), 200);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow    row;
            DateTime   dateCreated;
            Laboratory lab;

            foreach (LabCase labCase in labCaseList)
            {
                row         = new GridRow();
                dateCreated = labCase.DateTimeCreated;
                row.Cells.Add(dateCreated.ToString("ddd") + " " + dateCreated.ToShortDateString() + " " + dateCreated.ToShortTimeString());
                lab = Laboratories.GetOne(labCase.LaboratoryNum);
                if (lab == null)               //Lab wasn't found in the db, but we only require the LabCaseNum later.
                {
                    row.Cells.Add(Lan.g(this, "Lab Not Found"));
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(lab.Description);
                    row.Cells.Add(lab.Phone);
                }
                row.Cells.Add(labCase.Instructions);
                row.Tag = labCase;
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }