Example #1
0
        // Load listboxes with data
        private void LoadBoxes()
        {
            Clear();


            List <Member> allMembers =
                MemberHelper.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 =
                LibraryHelper.GetAllBooks();

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