private void toolStripLabel2_Click(object sender, EventArgs e) { string[] orders = GetSelectItems(); if (orders == null || orders.Length == 0) { return; } FrmSsYpWh frm = new FrmSsYpWh(EditType.add, orders); DialogResult dr = frm.ShowDialog(); if (dr == DialogResult.OK) { dataGridView1_SelectionChanged(null, null); } }
private void toolStripButton2_Click(object sender, EventArgs e) { //string[] orders = GetSelectItems(); //if (orders == null || orders.Length == 0) // return; if (dataGridView1.CurrentRow == null) { return; } string ORDER_ID = dataGridView1.CurrentRow.Cells["ORDER_ID"].Value != null ? dataGridView1.CurrentRow.Cells["ORDER_ID"].Value.ToString() : ""; FrmSsYpWh frm = new FrmSsYpWh(EditType.delete, new string[] { ORDER_ID }); DialogResult dr = frm.ShowDialog(); if (dr == DialogResult.OK) { dataGridView1_SelectionChanged(null, null); } }