public void InitializeUserBorrow()
        {
            try
            {
                BookBL  bookBl = new BookBL();
                DataSet ds     = bookBl.GetAllBooksBL();
                userId = UserLogin.userId;
                ObservableCollection <Book> lst = new ObservableCollection <Book>();

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    lst.Add(new Book
                    {
                        BookName   = Convert.ToString(dr["BookName"]),
                        BookId     = Convert.ToInt32(dr["BookId"]),
                        BookAuthor = Convert.ToString(dr["BookAuthor"]),
                        BookISBN   = Convert.ToString(dr["BookISBN"]),
                        BookCopies = Convert.ToInt32(dr["BookCopies"]),
                        BookPrice  = Convert.ToInt32(dr["BookPrice"]),
                    });
                }
                dgBorrow.ItemsSource = lst;
            }
            catch (Exception)
            {
                MessageBox.Show("Some unknown exception is occured!!!, Try again..");
            }
        }
Пример #2
0
        //REFRESH THE BOOK GRID VIEW =>PL
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            BookBL  bookBl = new BookBL();
            DataSet ds     = bookBl.GetAllBooksBL();

            dgvBookDetails.DataSource = ds.Tables[0];
        }
Пример #3
0
        public AdminBook()
        {
            InitializeComponent();
            BookBL  bookBl = new BookBL();
            DataSet ds     = bookBl.GetAllBooksBL();

            dgvBookDetails.DataSource = ds.Tables[0];
        }
Пример #4
0
        public UserBorrow()
        {
            InitializeComponent();
            userId = UserForm.UserId;
            BookBL  bookBl = new BookBL();
            DataSet ds     = bookBl.GetAllBooksBL();

            dgvBookDetails.DataSource = ds.Tables[0];
        }