private void btnNew_Click(object sender, EventArgs e) { frmUserGroupDetail frm = new frmUserGroupDetail(); if (frm.ShowDialog() == DialogResult.OK) { loadData(); } }
private void btnEdit_Click(object sender, EventArgs e) { try { int id = TextUtils.ToInt(grvData.GetFocusedRowCellValue(colID)); if (id == 0) { return; } UserGroupModel model = (UserGroupModel)UserGroupBO.Instance.FindByPK(id); frmUserGroupDetail frm = new frmUserGroupDetail(); frm.UserGroup = model; if (frm.ShowDialog() == DialogResult.OK) { loadData(); } } catch (Exception ex) { MessageBox.Show(ex.Message, TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Error); } }