Пример #1
0
        /// <summary>
        /// Редактирование
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            int      n    = BookGrid.SelectedCells[0].RowIndex;
            EditBook Edit = new EditBook();

            Edit.MdiParent      = this.MdiParent;
            Edit.ISBNBox.Text   = globals.BookList[n].isbn;
            Edit.AuthorBox.Text = globals.BookList[n].author;
            Edit.TitleBox.Text  = globals.BookList[n].title;
            Edit.PubBox.Text    = globals.BookList[n].publish;
            Edit.YearBox.Text   = globals.BookList[n].year;
            Edit.Show();
        }
Пример #2
0
 private void edit_Submit()
 {
     int row = Check_dataGridView1.CurrentCell.RowIndex;
     book.Book_id = Convert.ToInt16(Check_dataGridView1.Rows[row].Cells[0].Value);
     book.Title = Check_dataGridView1.Rows[row].Cells[1].Value.ToString();
     book.Content = Check_dataGridView1.Rows[row].Cells[2].Value.ToString();
     book.Num = Convert.ToInt16(Check_dataGridView1.Rows[row].Cells[3].Value);
     book.Date = (DateTime)Check_dataGridView1.Rows[row].Cells[4].Value;
     book.Publisher = Check_dataGridView1.Rows[row].Cells[5].Value.ToString();
     book.Publishing_home = Check_dataGridView1.Rows[row].Cells[6].Value.ToString();
     EditBook editor = new EditBook(book,this);
     editor.Show();
 }