Exemple #1
0
        private void btnadd_Click(object sender, EventArgs e)
        {
            bookGenerateId();
            BookEntry bookEntry = new BookEntry(this, CommonConstant.DB_INSERT);

            bookEntry.bookId = bookID;
            bookEntry.Show();
        }
Exemple #2
0
        private void bookDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int i;

            i = bookDataGridView.CurrentRow.Index;

            BookEntry bookEntry = new BookEntry(this, CommonConstant.DB_UPDATE);

            bookEntry.bookId                = bookDataGridView.Rows[i].Cells[0].Value.ToString();
            bookEntry.authorID              = bookDataGridView.Rows[i].Cells[1].Value.ToString();
            bookEntry.categoryId            = bookDataGridView.Rows[i].Cells[2].Value.ToString();
            bookEntry.publisherId           = bookDataGridView.Rows[i].Cells[3].Value.ToString();
            bookEntry.txtISBN.Text          = bookDataGridView.Rows[i].Cells[4].Value.ToString();
            bookEntry.txtTitle.Text         = bookDataGridView.Rows[i].Cells[5].Value.ToString();
            bookEntry.autName               = bookDataGridView.Rows[i].Cells[6].Value.ToString();
            bookEntry.catName               = bookDataGridView.Rows[i].Cells[7].Value.ToString();
            bookEntry.pubName               = bookDataGridView.Rows[i].Cells[8].Value.ToString();
            bookEntry.txtPurchaseprice.Text = bookDataGridView.Rows[i].Cells[9].Value.ToString();

            bookEntry.Show();
        }