Ejemplo n.º 1
0
        private void изменитьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                EditAuthor a = new EditAuthor();
                a.label_ID.Text = Convert.ToString(dataGridView1[0, dataGridView1.CurrentCell.RowIndex].Value);
                a.textBox1.Text = Convert.ToString(dataGridView1[1, dataGridView1.CurrentCell.RowIndex].Value);

                a.ShowDialog();
                ShowData();
            }
            catch (Exception) { MessageBox.Show("выберите запись", "ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); }
        }
        private void editAuthorbtn_Click(object sender, EventArgs e)
        {
            try
            {
                EditAuthor editAuthor = new EditAuthor();
                editAuthor.authorID = Int32.Parse(authorsDataGridView.Rows[authorsDataGridView.SelectedRows[0].Index].Cells[0].Value.ToString());
                editAuthor.ShowDialog();

                if (isChanged)
                {
                    InformationForm information = new InformationForm("Selected author is edited.", "Info");
                    information.Show();
                }
            }
            catch (ArgumentOutOfRangeException)
            {
                MessageBox.Show("Please select a row first!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                this.ViewAuthors_Load(sender, e);
            }
        }
Ejemplo n.º 3
0
        private void editAuthorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EditAuthor editAuthorForm = new EditAuthor(this.currentUser, this);

            editAuthorForm.ShowDialog();
        }