private void btnAdd_Click(object sender, EventArgs e) { RoleOptForm form = new RoleOptForm(); if (form.ShowDialog(this) == DialogResult.OK) { btnSearch_Click(null, null); } }
private void btnModify_Click(object sender, EventArgs e) { try { if (dgv.CurrentRow == null || dgv.CurrentRow.Index < 0) { FrmTips.ShowTipsError(AppHelper.MainForm, "未选中任何行!", ContentAlignment.MiddleCenter, 1000); return; } Role entity = CGridHelper.GetCurrentData <Role>(dgv); RoleOptForm form = new RoleOptForm(entity); if (form.ShowDialog(this) == DialogResult.OK) { btnSearch_Click(null, null); } } catch (Exception ex) { FrmTips.ShowTipsError(AppHelper.MainForm, "修改异常!" + ex.Message, ContentAlignment.MiddleCenter, 3000); } }