private void Add() { frmUserItem f = new frmUserItem(); if (f.ShowDialog() == DialogResult.OK) { RefreshDataGrid(); } }
private void Edit() { if (NoRecordDataGrid()) { return; } int row = m_dataGrid.CurrentCell.RowNumber; int col = 1; string UserName = m_dataGrid[row, col].ToString().ToString().Trim(); if (UserName == null) { MessageBox.Show("请正确选择需要编辑的用户行!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } frmUserItem f = new frmUserItem(UserName); if (DialogResult.OK == f.ShowDialog()) { RefreshDataGrid(); } }