/// <summary> /// 双击操作员列表行触发 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DgvOperator_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { //弹出窗口 if (e.ColumnIndex > -1 && e.RowIndex > -1) { if (null == m_formOperator) { m_formOperator = new CFormOperator(); } m_formOperator.FillOperatorInfo((COperatorDto)this.DgvOperator.Rows[e.RowIndex].DataBoundItem); m_formOperator.ShowDialog(this); } } catch (Exception exception) { MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "异常", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// 修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnModify_Click(object sender, EventArgs e) { try { if (1 != this.DgvOperator.SelectedRows.Count) { MessageBox.Show("请选择单行!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (null == m_formOperator) { m_formOperator = new CFormOperator(); } m_formOperator.FillOperatorInfo((COperatorDto)this.DgvOperator.SelectedRows[0].DataBoundItem); m_formOperator.ShowDialog(this); } catch (Exception exception) { MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "异常", MessageBoxButtons.OK, MessageBoxIcon.Error); } }