private void ButtonAdd_Click(object sender, EventArgs e) { DlgGoodsEdit dlg = new DlgGoodsEdit(); if (dlg.ShowDialog() == DialogResult.OK) { RefreshData(); } }
private void ButtonEdit_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRows.Count <= 0) { MessageBox.Show("请选择一行再操作"); return; } DataGridViewRow row = this.dataGridView1.SelectedRows[0]; DataRowView row_view = (DataRowView)row.DataBoundItem; DlgGoodsEdit dlg = new DlgGoodsEdit(row_view.Row); if (dlg.ShowDialog() == DialogResult.OK) { RefreshData(); } }