public void fillBookList()
        {
            try
            {
                lblBookTitlePageTitle.Text = bookmodel.BookTitle;
                txtBookTitle.Text          = bookmodel.BookTitle;
                txtBookDescription.Text    = bookmodel.BookDescription;
                txtAuthor.Text             = bookmodel.Author;
                txtBookCategory.Text       = bookmodel.BookCategory;
                txtPublisherName.Text      = bookmodel.PublisherName;
                dtpPublishDate.Value       = bookmodel.PublishDate.Value;
                txtRentalPricePerDay.Text  = bookmodel.RentalPricePerDay.ToString();
                maxAvaiableDaysToRent.Text = bookmodel.MaxAvailableDayToRent.ToString();
            }
            catch { }
            dt.Rows.Clear();

            var books = EntityBroker.getBooksByBookModelID(bookmodel.BookModelId);

            dgvListOfCopies.DataSource = null;
            foreach (Book book in books)
            {
                string lend_date_str = "-";
                string due_date_str  = "-";

                string status = (book.BookStatus == 0) ? "Rented" : (book.BookStatus == 1) ? "Avaiable" : "Not Avaiable";

                LibTran t = EntityBroker.getLastTransationByBookID(book.BookID);

                if (book.BookStatus == 0)
                {
                    lend_date_str = t.LendDate.ToString("dd MM yyyy");
                    DateTime DueDate = t.LendDate.AddDays(Convert.ToDouble(bookmodel.MaxAvailableDayToRent));
                    due_date_str = DueDate.ToString("dd MM yyyy");
                }

                dt.Rows.Add(
                    book.BookID,
                    status,
                    lend_date_str,
                    due_date_str
                    );
            }
        }
        public Window_Popup_ReturnBook(int _book_id)
        {
            InitializeComponent();
            this.FormBorderStyle = FormBorderStyle.FixedSingle; //make unresizable

            transaction = EntityBroker.getLastTransationByBookID(_book_id);
            book        = EntityBroker.getBookByBookID(_book_id);
            member      = EntityBroker.getMemberByMemberID(transaction.MemberID);
            bookmodel   = EntityBroker.getBookModelByID(book.BookModelID);

            calculateCharge();

            lblBookTitle.Text = bookmodel.BookTitle;

            lblBookIDValue.Text     = book.BookID.ToString();
            lblMemberNameValue.Text = member.MemberName;
            lblMemberIDValue.Text   = member.MemberID.ToString();
            lblRentDateValue.Text   = transaction.LendDate.ToString("dd MM, yyyy");
            lblChargeValue.Text     = charge.ToString();
        }