示例#1
0
文件: Form1.cs 项目: YannickB23/Books
        private void btnDelete_Click(object sender, EventArgs e)
        {
            var book = new Book
            {
                Id          = int.Parse(lblId.Text),
                Title       = txtTitle.Text,
                Author      = txtAuthor.Text,
                Price       = decimal.Parse(txtPrice.Text),
                Description = txtDescription.Text,
                CountryId   = (int)cmbCountry.SelectedValue
            };

            BookRepo repo = new BookRepo();

            repo.DeleteBookId(book.Id);
            LoadBooks();
        }