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

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

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

            if (dialogResult == DialogResult.Yes)
            {
                BookFile.DeleteBook(myBook, cwid);
                LoadList();
            }
        }
示例#3
0
        private void BtnSave_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.cover  = txtCoverData.Text;
            myBook.length = int.Parse(txtLengthData.Text);
            myBook.cwid   = cwid;

            BookFile.SaveBook(myBook, cwid, mode);

            MessageBox.Show("Content was saved", "saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
示例#4
0
 private void LoadList()
 {
     myBooks             = BookFile.GetAllBooks(cwid);
     lstBooks.DataSource = myBooks;
 }