コード例 #1
0
        public Boolean ShowUserBook(int uid, MainControl mc, TabPage tb)
        {
            List <User_Book> booklist = User_BookServices.GetUserBooks(uid);

            //int i = Convert.ToInt32(booklist[1].book_id);
            //List<Book> book = null;
            if (booklist.Count != 0)
            {
                int         i    = 0;
                List <Book> book = new List <Book>();
                foreach (var b in booklist)
                {
                    book.Add(BookServices.GetById(Convert.ToInt32(booklist[i++].book_id)));
                }
                // = BookServices.CatagorySearch(category);

                foreach (var o in book)
                {
                    IndividualBook ib = new IndividualBook();
                    ib.setData(o, tb);
                    flowLayoutPanel.Controls.Add(ib);
                }

                return(true);
                //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");
                return(false);
            }
        }
コード例 #2
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            this.Hide();
            MainControl mc = new MainControl();

            //sf.btnBack.Visible = true;
            sf.pictureBack.Visible = true;
            p.Controls.Add(mc);
        }
コード例 #3
0
        public void HomePage(MainControl mc, TabPage tb)
        {
            List <Book> book = BookServices.GroupByMaximum();

            //List<Book> book = null;
            if (book.Count != 0)
            {
                foreach (var o in book)
                {
                    IndividualBook ib = new IndividualBook();
                    ib.setData(o, tb);
                    flowLayoutPanel.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");
            }
        }