Esempio n. 1
0
        private void AddBook()
        {
            BrowseBook bookbrowse = new BrowseBook();

            bookbrowse.BookName = bookNameTxtBox.Text;
            bookbrowse.BookId   = bookIdTextBox.Text;
            bookbrowse.Author   = authorTextBox.Text;
            bookbrowse.Catagory = catagoryTextBox.Text;


            dataAccess.AddBook(bookbrowse);
            //LibraryDBDataContext cntx = new LibraryDBDataContext(Library_Managment_System.UI.Properties.Settings.Default.librarydbConnectionString);

            //cntx.BrowseBooks.InsertOnSubmit(browsebook);
            //cntx.SubmitChanges();
        }
Esempio n. 2
0
        private void addNewBookButton_Click(object sender, EventArgs e)
        {
            DataAccess db = new DataAccess();

            db.AddBook(int.Parse(textBoxID.Text),
                       textBoxAuthorFirstName.Text,
                       textBoxAuthorLastName.Text,
                       textBoxBookTitle.Text,
                       int.Parse(textBoxDate.Text),
                       textBoxPublisher.Text);
            textBoxAuthorFirstName.Text = "";
            textBoxAuthorLastName.Text  = "";
            textBoxBookTitle.Text       = "";
            textBoxDate.Text            = "";
            textBoxPublisher.Text       = "";
        }