示例#1
0
        private void ButtonReturn_Click(object sender, EventArgs e)
        {
            Book myBook = (Book)listBooks.SelectedItem;

            myBook.copies++;
            BookFile.SaveBook(myBook, cwid, "edit");
            LoadList();
        }
示例#2
0
        private void ButtonDelete_Click(object sender, EventArgs e)
        {
            Book myBook = (Book)listBooks.SelectedItem;

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

            if (dialogResult == DialogResult.Yes)
            {
                BookFile.DeleteBook(myBook, cwid);
                LoadList();
            }
        }
示例#3
0
        private void ButtonSave_Click(object sender, EventArgs e)
        {
            myBook.title  = textTitle.Text;
            myBook.author = textAuthor.Text;
            myBook.genre  = textGenre.Text;
            myBook.copies = int.Parse(textCopies.Text);
            myBook.length = int.Parse(textLength.Text);
            myBook.isbn   = textISBN.Text;
            myBook.cover  = textCover.Text;
            myBook.cwid   = cwid;

            BookFile.SaveBook(myBook, cwid, mode);

            MessageBox.Show("Content Saved", "Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);

            this.Close();
        }
示例#4
0
 private void LoadList()
 {
     myBooks = BookFile.GetAllBooks(cwid);
     listBooks.DataSource = myBooks;
 }