Esempio n. 1
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn("Date Start", 70);

            col.TextAlign = HorizontalAlignment.Center;
            gridMain.Columns.Add(col);
            col           = new ODGridColumn("Date End", 70);
            col.TextAlign = HorizontalAlignment.Center;
            gridMain.Columns.Add(col);
            col = new ODGridColumn("SOP Code", 70);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Description", 250);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Note", 100);
            gridMain.Columns.Add(col);
            ListPayorTypes = PayorTypes.Refresh(PatCur.PatNum);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < ListPayorTypes.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(ListPayorTypes[i].DateStart.ToShortDateString());
                if (i == ListPayorTypes.Count - 1)
                {
                    row.Cells.Add("Current");
                }
                else
                {
                    row.Cells.Add(ListPayorTypes[i + 1].DateStart.ToShortDateString());
                }
                row.Cells.Add(ListPayorTypes[i].SopCode);
                row.Cells.Add(Sops.GetDescriptionFromCode(ListPayorTypes[i].SopCode));
                row.Cells.Add(ListPayorTypes[i].Note);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }