Beispiel #1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            Book    myBook = (Book)lstBooks.SelectedItem;
            frmEdit myForm = new frmEdit(myBook, "edit", cwid);

            if (myForm.ShowDialog() == DialogResult.OK)
            {
            }
            else
            {
                LoadList();
            }
        }
Beispiel #2
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            Book    myBook = new Book();
            frmEdit myForm = new frmEdit(myBook, "new", cwid);

            if (myForm.ShowDialog() == DialogResult.OK)
            {
            }
            else
            {
                LoadList();
            }
        }
Beispiel #3
0
        private void BtnNew_Click(object sender, EventArgs e) //also opens the edit menu, but in the new configuration
        {
            Book    myBook = new Book();
            frmEdit myForm = new frmEdit(myBook, "new", cwid);

            if (myForm.ShowDialog() == DialogResult.OK)
            {
            }
            else
            {
                LoadList();
            }
        }
Beispiel #4
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                var book = (Book)lbBooks.SelectedItem;

                frmEdit editForm = new frmEdit(book, cwid);
                if (editForm.ShowDialog() == DialogResult.OK)
                {
                    var editedBook = (Book)editForm.Tag;

                    BookFile.SaveBook(editedBook, cwid, "edit");

                    LoadBooks();
                }
            }
            catch (Exception exc) { }
        }
Beispiel #5
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            try
            {
                var book = new Book();

                frmEdit newForm = new frmEdit(book, cwid);
                if (newForm.ShowDialog() == DialogResult.OK)
                {
                    var editedBook = (Book)newForm.Tag;

                    BookFile.SaveBook(editedBook, cwid, "");

                    LoadBooks();
                }
            }
            catch (Exception exc) { }
        }