Esempio n. 1
0
        private void btnReturn_Click(object sender, EventArgs e)
        {
            Book myBook = (Book)lstBooks.SelectedItem;

            myBook.copies++;
            BookFile.SaveBook(myBook, cwid, "edit");
            LoadList();
        }
Esempio n. 2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            Book myBook = (Book)lstBooks.SelectedItem;

            DialogResult dialogResult = MessageBox.Show("Are you sure you want to delete?", " Delete", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                BookFile.DeleteBook(myBook, cwid);
                LoadList();
            }
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            myBook.title  = txtTitleData.Text;
            myBook.author = txtAuthorData.Text;
            myBook.genre  = txtGenreData.Text;
            myBook.copies = int.Parse(txtCopiesData.Text);
            myBook.isbn   = txtISBNDATA.Text;
            myBook.length = int.Parse(txtLengthData.Text);
            myBook.cover  = txtCoverData.Text;
            myBook.cwid   = cwid;

            BookFile.SaveBook(myBook, cwid, mode);

            MessageBox.Show("COntent was saved", "Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);

            this.Close();
        }
Esempio n. 4
0
 private void LoadList()
 {
     myBooks             = BookFile.GetAllBooks(cwid);
     lstBooks.DataSource = myBooks;
 }