Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtTitle.Text.Trim()))
            {
                MessageBox.Show("One or more field haven't been filled correctly");
                return;
            }

            if (libraryApp.AddBook(txtTitle.Text.Trim(), txtAuthor.Text.Trim(), txtPublisher.Text.Trim(), dtpPublished.Value))
            {
                MessageBox.Show("Success");
                txtTitle.Text     = "";
                txtAuthor.Text    = "";
                txtPublisher.Text = "";
                return;
            }
            MessageBox.Show("Error occurred\n Please relogin if the error continues!");
        }