示例#1
0
        private void BtnUpdateBook_Click(object sender, EventArgs e)
        {
            this.Hide();
            UpdateBook updateBook = new UpdateBook(int.Parse(dgwBooks.CurrentRow.Cells[0].Value.ToString()));

            updateBook.Show();
        }
示例#2
0
        private void UpdateSelectedBookToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGridView_Books.CurrentCell == null)
            {
                return;
            }
            if (dataGridView_Books.CurrentRow != null)
            {
                var book = _books[dataGridView_Books.CurrentRow.Index];

                var updateBook = new UpdateBook(book);
                if (updateBook.ShowDialog() == DialogResult.OK)
                {
                    MessageBox.Show(_dal.UpdateBook(updateBook.Book)
                        ? @"Книга была успешно изменена"
                        : @"Изменения не были произведены");
                }
            }
            Button_Refresh_Click(null, null);
        }
示例#3
0
        private void updateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UpdateBook updateBook = new UpdateBook();

            updateBook.ShowDialog();
        }