private void toolStripButtonEDIT_Click(object sender, EventArgs e) { object[] oT = new object[dataGridViewDJMX.ColumnCount]; if (dataGridViewDJMX.SelectedRows.Count < 1) { MessageBox.Show("请选择要修改的账簿", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } dSet.Tables["账簿表1"].Clear(); DataTable dt = dSet.Tables["账簿表1"]; for (int i = dataGridViewDJMX.SelectedRows.Count - 1; i >= 0; i--) { for (int j = 0; j < oT.Length; j++) { oT[j] = dataGridViewDJMX.SelectedRows[i].Cells[j].Value; } dt.Rows.Add(oT); } FormZBDAWH_CARD frmZBDAWH_CARD = new FormZBDAWH_CARD(); frmZBDAWH_CARD.strConn = strConn; frmZBDAWH_CARD.dt = dt; frmZBDAWH_CARD.iStyle = 1; frmZBDAWH_CARD.ShowDialog(); initDataView(); }
private void ToolStripButtonADD_Click(object sender, EventArgs e) { dSet.Tables["账簿表1"].Clear(); DataTable dt = dSet.Tables["账簿表1"]; FormZBDAWH_CARD frmZBDAWH_CARD = new FormZBDAWH_CARD(); frmZBDAWH_CARD.strConn = strConn; frmZBDAWH_CARD.dt = dt; frmZBDAWH_CARD.iStyle = 0; frmZBDAWH_CARD.ShowDialog(); initDataView(); }