private void 修改检测技术ToolStripMenuItem_Click(object sender, EventArgs e) { try { if (this.gridView4.RowCount == 0 || this.gridView4.GetSelectedRows()[0] < 0) { MessageBox.Show("请选中要修改的行"); return; } strOperationFlag = "modify"; Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("检测技术编号", this.gridView4.GetRowCellValue(this.gridView4.FocusedRowHandle, this.gridView4.Columns[0]).ToString()); dic.Add("检测技术名称", this.gridView4.GetRowCellValue(this.gridView4.FocusedRowHandle, this.gridView4.Columns[1]).ToString()); FormDETECTION_TECHNOLOGYInfoEdit frm = new FormDETECTION_TECHNOLOGYInfoEdit(strOperationFlag, dic); frm.Owner = this; frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { FreshForm(); } } catch (System.Exception ex) { MessageBox.Show("修改检测技术信息时发生错误!" + ex.Message, "提示信息"); return; } }
private void 添加检测技术ToolStripMenuItem_Click(object sender, EventArgs e) { try { strOperationFlag = "add"; FormDETECTION_TECHNOLOGYInfoEdit frm = new FormDETECTION_TECHNOLOGYInfoEdit(strOperationFlag, null); frm.Owner = this; frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { FreshForm(); } } catch (System.Exception ex) { MessageBox.Show("添加检测技术信息时发生错误!" + ex.Message, "提示信息"); return; } }