Ejemplo n.º 1
0
        }     //End Search

        private void grdBookList_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //Extract BookID from column 0 of selected row
            Books aBook = new Books();

            //Retrieve details from this member item from DB
            aBook.getBook(Convert.ToInt32(grdBookList.Rows[grdBookList.CurrentCell.RowIndex].Cells[0].Value));

            //Load instance variable values onto form
            txtBookID.Text  = aBook.getBookID().ToString("0000");
            txtISBN.Text    = aBook.getISBN();
            txtClassNo.Text = aBook.getClassNo();

            //Subject
            //Declare Variable to hold Subject Name
            strSubjectName          = Books.getSubjectName(aBook.getSubjectCode());
            cmbSubject.SelectedItem = strSubjectName;

            txtTitle.Text    = aBook.getTitle();
            txtAuthor.Text   = aBook.getAuthor();
            nudEdition.Value = aBook.getEdition();
            txtPrice.Text    = aBook.getPrice().ToString();
            txtPages.Text    = aBook.getPage().ToString();
            txtPName.Text    = aBook.getPubName();

            //Country
            //Declare Variable to hold Country Name
            strCountryName          = Books.getCountryName(aBook.getCountry());
            cmbCountry.SelectedItem = strCountryName;

            txtYearPub.Text = aBook.getYearPub();

            //Display Member details
            grpBookInfo.Visible = true;
        } //End Cell Click Event