Пример #1
0
        private void editToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (!edit)
            {
                return;
            }
            var st = new PrintingDataSet.BooksDataTable();

            booksTableAdapter.FillBy(st,
                                     Convert.ToInt32(dataGridViewBooks.SelectedRows[0].Cells[0].Value));
            object[] row = st.Rows[0].ItemArray;
            var      edt = new BooksEdit(
                Convert.ToInt32(row[0]),
                row[1].ToString(),
                row[2].ToString(),
                Convert.ToInt32(row[3]),
                Convert.ToInt32(row[4]),
                Convert.ToInt32(row[5]),
                Convert.ToInt32(row[6]),
                Convert.ToInt32(row[7]),
                Convert.ToInt32(row[8]),
                Convert.ToInt32(row[9])
                );

            edt.ShowDialog();
            booksTableAdapter.Fill(printingDataSet.Books);
            printingDataSet.AcceptChanges();
        }
Пример #2
0
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!edit)
            {
                return;
            }
            var edt = new BooksEdit();

            edt.ShowDialog();
            booksTableAdapter.Fill(printingDataSet.Books);
            printingDataSet.AcceptChanges();
        }