예제 #1
0
        public void UpdateDataGridView(DataGridView dgv, ToolStripStatusLabel countBooksInDb)
        {
            try
            {
                fcSchoolLibrary.Dispose();

                fcSchoolLibrary = new FCSchoolLibrary();

                dgv.DataSource = fcSchoolLibrary.Books.OrderBy(i => i.InventoryNumber).Select(b => new { Id     = b.Id, InventoryNumber = b.InventoryNumber,
                                                                                                         Author = b.Author, Name = b.Name, Department = b.Department, Chipher = b.Cipher }).ToList();

                countBooksInDb.Text = dgv.RowCount.ToString();
            }
            catch (Exception ex)
            {
                new FormException(ex.Message).ShowDialog();
            }
        }