コード例 #1
0
 private void BtnAddBook_Click(object sender, EventArgs e)
 {
     if (isValidInt())
     {
         Book book = new Book();
         book.BookISBN  = txtISBN.Text;
         book.BookPrice = Convert.ToDecimal(txtPrice.Text);
         book.BookTitle = txtTitle.Text;
         BookDB.AddBook(book);
         price        = Convert.ToDecimal(txtPrice.Text);
         DialogResult = DialogResult.OK;
     }
 }
コード例 #2
0
        private void btnSaveBook_Click(object sender, EventArgs e)
        {
            Book book = new Book();

            book.Title = txtTitle.Text;
            book.ISBN  = txtISBN.Text;

            BookDB.AddBook(book);
            MessageBox.Show("Book Added!");
            New_Book = book;

            DialogResult = DialogResult.OK;
            Close();
        }