コード例 #1
0
        private void BtnAddBook_Click(object sender, RoutedEventArgs e)
        {
            if (!Validation())
            {
                return;
            }

            Book book = new Book
            {
                Name     = tbBookName.Text,
                Author   = tbAuthorName.Text,
                CountNow = Convert.ToInt32(tbBookCount.Text),
                Count    = Convert.ToInt32(tbBookCount.Text),
                Price    = Convert.ToDecimal(tbPrice.Text)
            };

            dr.AddBooks(book);
            FillDG();
            ResetTextBox();
        }