Example #1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            searchFlowLayout.Controls.Clear();
            List <Book> book = BookServices.BookSearch(searchTextBox.Text);

            //List<Book> book = null;
            if (book.Count != 0)
            {
                foreach (var o in book)
                {
                    IndividualBook ib = new IndividualBook();
                    ib.setData(o, tb);
                    searchFlowLayout.Controls.Add(ib);
                }
                //MessageBox.Show("Book available.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                //MetroFramework.MetroMessageBox.Show(mc, "No Book available.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                MessageBox.Show("No Book available.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //Console.WriteLine("no book found");
            }
        }