예제 #1
0
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!edit)
            {
                return;
            }
            var edt = new CustomersEdit();

            edt.ShowDialog();
            customersTableAdapter.Fill(printingDataSet.Customers);
            printingDataSet.AcceptChanges();
        }
예제 #2
0
        private void editToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (!edit)
            {
                return;
            }
            var st = new PrintingDataSet.CustomersDataTable();

            customersTableAdapter.FillBy(st,
                                         Convert.ToInt32(dataGridViewCustomers.SelectedRows[0].Cells[0].Value));
            object[] row = st.Rows[0].ItemArray;
            var      edt = new CustomersEdit(
                Convert.ToInt32(row[0]),
                row[1].ToString(),
                row[2].ToString(),
                row[3].ToString(),
                row[4].ToString()
                );

            edt.ShowDialog();
            customersTableAdapter.Fill(printingDataSet.Customers);
            printingDataSet.AcceptChanges();
        }