Beispiel #1
0
        /// <summary>
        /// Clears form and loads list boxes with data.
        /// </summary>
        private void LoadBoxes()
        {
            Clear();

            List <Member> allMembers =
                MemberDB.GetAllMembers();

            if (allMembers != null)
            {
                foreach (Member m in allMembers)
                {
                    lstMembers.Items.Add($"{m.MemberID}, " +
                                         $"{m.Username},  " +
                                         $"{m.LastName},  " +
                                         $"{m.FirstName},  " +
                                         $"Admin: " +
                                         $"{m.IsAdmin}");
                }
            }

            List <Book> allBooks =
                LibraryDB.GetAllBooks();

            if (allBooks != null)
            {
                foreach (Book b in allBooks)
                {
                    lstBooks.Items.Add($"{b.ISBN}, " +
                                       $"{b.Title},  " +
                                       $"{b.Author},  " +
                                       $"{b.PubDate},  " +
                                       $"{b.Category}");
                }
            }
        }