Пример #1
0
        private void btnEdit_Click(object sender, EventArgs e) // method for when the edit button is clicked
        {
            Book    myBook = (Book)lstBooks.SelectedItem;
            frmEdit myForm = new frmEdit(myBook, "edit", cwid);

            if (myForm.ShowDialog() == DialogResult.OK)
            {
            }
            else
            {
                LoadList(); //reloads the list
            }
        }
Пример #2
0
        private void btnNew_Click(object sender, EventArgs e)  //method for when the user wants to create new
        {
            Book    myBook = new Book();                       //cast selected object to a book
            frmEdit myForm = new frmEdit(myBook, "new", cwid); //creates form

            if (myForm.ShowDialog() == DialogResult.OK)
            {
                //in form
            }
            else
            {
                LoadList();
            }
        }