コード例 #1
0
        private void addBookButton_Click(object sender, EventArgs e)
        {
            int?   ID      = Convert.ToInt32(idNumericUpDown1.Value);
            string Author  = authorTextBox.Text;                         // Author    2
            string Title   = titleTextBox.Text;                          // Title   3
            string Journal = publisherTextBox.Text;                      // Journal 4
            int    Year    = yearTimePicker1.Value.Year;                 // Year  5
            int    Pages   = Convert.ToInt32(pagesNumericUpDown1.Value); // Pages   6
            int    Tom     = Convert.ToInt32(tomNumericUpDown3.Value);   // Tom 7
            int    Issue   = Convert.ToInt32(issueNumericUpDown2.Value); // Stock   8

            //  ********************************************************
            if (monthDayCheckBox2.Checked)
            {
                Month = yearTimePicker1.Value.Month; // Stock   9
                Day   = yearTimePicker1.Value.Day;   // Stock   10
            }
            else
            {
                Month = null;
                Day   = null;
            }

            string City   = cityTextBox.Text;   // City  11
            string Editor = editorTextBox.Text; // Publisher   12

            // **********************************************************


            DBItems.Initialize();
            DBItems.addJournal(ID, Author, Title, Journal, Year, Pages, Tom, Issue, Month, Day, City, Editor);



            this.Close();
        }