Exemple #1
0
        //load when the form load
        private void SearchBook_load(object sender, EventArgs e)
        {
            dataGridView1.DataSource = bl.ListBooks();
            DeleteEdit_panel.Visible = false;

            //List of all the category
            catList.DataSource    = bl.CategoryList();
            catList.DisplayMember = "CategoryName";

            //List of all the author
            authorList.DataSource    = bl.AuthorList();
            authorList.DisplayMember = "AuthorName";

            //only Admin can edit delete a book
            if (staticUserLevel == 3)
            {
                DeleteEdit_panel.Visible = true;
            }
        }
        /// <summary>
        /// Loading script when form load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ReserveBorrowBook_load(object sender, EventArgs e)
        {
            panelSearch.Visible   = true;
            dataGridView1.Visible = false;

            loadDataGridViewWithImage(null, e);

            catList.DataSource    = bl.CategoryList();
            catList.DisplayMember = "CategoryName";

            //BookLogic bl2 = new BookLogic();
            authorList.DataSource    = bl.AuthorList();
            authorList.DisplayMember = "AuthorName";

            if (staticUserLevel == 2 || staticUserLevel == 3)
            {
                userID_panel.Visible = true;
            }
            else
            {
                userID_panel.Visible = false;
            }
        }