コード例 #1
0
        private void btnEditPublisher_Click(object sender, EventArgs e)
        {
            if (dgvPublishers.Rows.Count == 0)
            {
                return;
            }

            var selectedRow = dgvPublishers.SelectedRows[0];

            if (selectedRow == null)
            {
                return;
            }

            var publisherId = int.Parse(selectedRow.Cells[0].Value.ToString());

            using (var updatePublisherForm = new InsertOrUpdatePublisherForm(publisherId)) {
                updatePublisherForm.ShowDialog(this);

                if (updatePublisherForm.DialogResult == DialogResult.OK)
                {
                    ReloadPublishers();
                }
            }
        }
コード例 #2
0
        private void btnNewPublisher_Click(object sender, EventArgs e)
        {
            using (var insertPublisherForm = new InsertOrUpdatePublisherForm()) {
                insertPublisherForm.ShowDialog(this);

                if (insertPublisherForm.DialogResult == DialogResult.OK)
                {
                    ReloadPublishers();
                }
            }
        }