コード例 #1
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            switch (tabControl.SelectedIndex)
            {
            case 0:
                var editBook = new FormAddAndEdit();

                editBook.EditBook(userControlBooks.SelectedBook);
                editBook.ShowDialog();
                userControlBooks.ReloadBooks();
                break;

            case 1:
                var editAuthor = new FormAddAndEdit();

                editAuthor.EditAuthor(userControlAuthors.SelectedAuthor);
                editAuthor.ShowDialog();
                userControlAuthors.ReloadAuthors();
                break;

            case 2:
                var editPublisher = new FormAddAndEdit();

                editPublisher.EditPublisher(userControlPublishers.SelectedPublisher);
                editPublisher.ShowDialog();
                userControlPublishers.ReloadPublishers();
                break;
            }
        }
コード例 #2
0
        private void buttonAddBook_Click(object sender, EventArgs e)
        {
            var addAndEdit = new FormAddAndEdit();

            addAndEdit.StockBalanceCreated += AddAndEdit_StockBalanceCreated;
            addAndEdit.AddStockBalance(selectedBookstore);
            addAndEdit.ShowDialog();

            ReloadStockBalance(selectedBookstore);
        }