private void btnNew_Click(object sender, EventArgs e) { int id = TextUtils.ToInt(treeData.FocusedNode.GetValue(colIDTree)); if (id > 0 && !isParent(id)) { frmPermission frm = new frmPermission(); frm.CatID = id; if (frm.ShowDialog() == DialogResult.OK) { LoadInfoSearch(); } } }
private void btnEdit_Click(object sender, EventArgs e) { int id = TextUtils.ToInt(grvData.GetFocusedRowCellValue(colID)); if (id == 0) { return; } FormAndFunctionModel model = (FormAndFunctionModel)FormAndFunctionBO.Instance.FindByPK(id); int catId = TextUtils.ToInt(grvData.GetFocusedRowCellValue(colCat)); _RownIndex = grvData.FocusedRowHandle; frmPermission frm = new frmPermission(); frm.CatID = catId; frm.Model = model; if (frm.ShowDialog() == DialogResult.OK) { LoadInfoSearch(); } }