public void ShowTable()
        {
            dataGridViewB.Rows.Clear();
            model = new ModelContainer();

            List <string[]> data = new List <string[]>();

            foreach (Books book in model.BooksSet)
            {
                data.Add(new string[4]);

                data[data.Count - 1][0] = book.Id.ToString();
                data[data.Count - 1][1] = book.Name;
                data[data.Count - 1][2] = book.Author.Surname + " " + book.Author.Name + " " + book.Author.SecondName;
                data[data.Count - 1][3] = book.Genre.Name;

                dataGridViewB.Rows.Add(data[data.Count - 1]);
            }
        }
Exemplo n.º 2
0
        public void ShowTable()
        {
            dataGridViewBE.Rows.Clear();
            model = new ModelContainer();

            List <string[]> data         = new List <string[]>();
            var             bookexemplar = model.BookExemplarSet.Where(x => x.Books.Id == book.Id);

            foreach (BookExemplar bookExemplar in bookexemplar)
            {
                data.Add(new string[7]);

                data[data.Count - 1][0] = bookExemplar.Id.ToString();
                data[data.Count - 1][1] = bookExemplar.Year.ToString();
                data[data.Count - 1][2] = bookExemplar.Series.Name;
                data[data.Count - 1][3] = bookExemplar.Series.CoverType;
                data[data.Count - 1][4] = bookExemplar.Number.ToString();
                data[data.Count - 1][5] = bookExemplar.Store.Name;
                data[data.Count - 1][6] = bookExemplar.Store.City.Name + " " + bookExemplar.Store.Address;

                dataGridViewBE.Rows.Add(data[data.Count - 1]);
            }
        }