コード例 #1
0
ファイル: Form1.cs プロジェクト: taxilian/some_library
        private void UpdateOverdueGrid()
        {
            List <MediaItem> items = lib.GetCheckedOutMedia(cbFilterODByCheckedOutPerson.SelectedItem as Patron);

            overDueGrid.Rows.Clear();
            int r = 0;

            foreach (MediaItem item in items)
            {
                if (item.due_date.Value > currentDate.Value)
                {
                    continue;
                }

                overDueGrid.Rows.Add();
                overDueGrid.Rows[r].Tag            = item;
                overDueGrid.Rows[r].Cells[0].Value = item.name;
                overDueGrid.Rows[r].Cells[1].Value = item.type.ToString();
                string status = "Overdue";
                overDueGrid.Rows[r].Cells[2].Value = status;
                if (item.checked_to != null)
                {
                    overDueGrid.Rows[r].Cells[3].Value = item.checked_to.name;
                    overDueGrid.Rows[r].Cells[4].Value = item.checkout_date.Value.ToShortDateString();
                    overDueGrid.Rows[r].Cells[5].Value = item.due_date.Value.ToShortDateString();
                }
                r++;
            }
        }