Beispiel #1
0
        private void btnAddBook_Click(object sender, EventArgs e)
        {
            BookName    = this.txtBookName.Text;
            Author      = this.txtAuthor.Text;
            IDcategory  = comboBoxBookCategory.SelectedValue.ToString();
            IDLanguage  = comboBoxBookLanguage.SelectedValue.ToString();
            ISBN        = this.txtISBN.Text;
            Publisher   = this.txtPublisher.Text;
            Description = this.richTxtBookDescreption.Text;
            image       = this.txtImagePath.Text;

            if (database.addBook(BookName, Author, IDcategory, IDLanguage, image, ISBN, Publisher, Description))
            {
                MessageBox.Show("Book successfully added");
                pictureBox1.Image           = Properties.Resources.noimage;
                txtImagePath.Text           = null;
                txtBookName.Text            = null;
                txtAuthor.Text              = null;
                txtISBN.Text                = null;
                txtPublisher.Text           = null;
                richTxtBookDescreption.Text = null;
            }

            else
            {
                MessageBox.Show("Book Not added, please check Debug Log");
            }
        }