예제 #1
0
파일: frmMain.cs 프로젝트: mcahern/PA6MCA
        private void btnReturn_Click(object sender, EventArgs e)
        {
            Book myBook = (Book)lstBooks.SelectedItem;

            myBook.copies++;
            BookFile.SaveBook(myBook, cwid, "edit");
            LoadList();
        }
예제 #2
0
파일: frmMain.cs 프로젝트: mcahern/PA6MCA
        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();
            }
        }
예제 #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
파일: frmMain.cs 프로젝트: mcahern/PA6MCA
 private void LoadList()
 {
     myBooks             = BookFile.GetAllBooks(cwid);
     lstBooks.DataSource = myBooks;
 }