private void btnAdd_Click(object sender, EventArgs e) { frmProductSupplierInfoAdd myfrmProSupInfo = new frmProductSupplierInfoAdd(); myfrmProSupInfo.ShowDialog(); if (myfrmProSupInfo.DialogResult == DialogResult.OK) { btnSearch_Click(sender, e); } }
private void btnModify_Click(object sender, EventArgs e) { int count = this.gdvInfo.SelectedRowsCount; if (count == 0) { MessageBox.Show("请先搜索/刷新并选择需要修改的用户行", "错误!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string paramProductID = this.gdvInfo.GetFocusedRowCellValue("product_id").ToString(); string paramProductName = this.gdvInfo.GetFocusedRowCellValue("product_name").ToString(); string paramSupplierID = this.gdvInfo.GetFocusedRowCellValue("supplier_id").ToString(); string paramSupplierName = this.gdvInfo.GetFocusedRowCellValue("name").ToString(); string paramPrice = this.gdvInfo.GetFocusedRowCellValue("pro_price").ToString(); string paramRemark = this.gdvInfo.GetFocusedRowCellValue("remark").ToString(); frmProductSupplierInfoAdd myfrmProSupInfo = new frmProductSupplierInfoAdd(paramProductID, paramProductName, paramSupplierID, paramSupplierName, paramPrice, paramRemark); myfrmProSupInfo.ShowDialog(); if (myfrmProSupInfo.DialogResult == DialogResult.OK) { btnSearch_Click(sender, e); } }