private void toolStripButton_Add_Click(object sender, EventArgs e) { frmProductClsEdit f = new frmProductClsEdit("add"); f.Owner = this; if (f.ShowDialog() == DialogResult.OK) { this.BindData("1=1"); } }
private void toolStripButton_Edit_Click(object sender, EventArgs e) { if (this.dgvMain.SelectedRows.Count > 0) { DataRow dr = ((DataRowView)dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].DataBoundItem).Row; frmProductClsEdit f = new frmProductClsEdit("edit"); f.Owner = this; f.drEdit = dr; if (f.ShowDialog() == DialogResult.OK) { this.BindData("1=1"); } } else { Logger.Info("请选择要修改的数据行"); } }