protected void btnSave_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.QueryString["rCode"])) { string rCode = Request.QueryString["rCode"]; Maticsoft.BLL.tRoleMenu BLLtt = new Maticsoft.BLL.tRoleMenu(); BLLtt.Delete(int.Parse(rCode)); FineUIPro.TreeNode[] nodes = TreeDpt.GetCheckedNodes(); if (nodes.Length > 0) { Maticsoft.Model.tRoleMenu m = new Maticsoft.Model.tRoleMenu(); Maticsoft.BLL.tRoleMenu BLL = new Maticsoft.BLL.tRoleMenu(); foreach (FineUIPro.TreeNode node in nodes) { m.rCode = int.Parse(rCode); m.mCode = int.Parse(node.NodeID); BLL.Add(m); } PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } else { Alert.ShowInTop("操作失败!"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { btnClose.OnClientClick = ActiveWindow.GetHideReference(); BindTree(); if (!string.IsNullOrEmpty(Request.QueryString["rCode"])) { string rCode = Request.QueryString["rCode"]; Maticsoft.BLL.tRoleMenu BLLtt = new Maticsoft.BLL.tRoleMenu(); List <Maticsoft.Model.tRoleMenu> list = BLLtt.GetModelList(string.Format(" rCode={0}", rCode)); string[] strR = new string[list.Count]; for (int i = 0; i < list.Count; i++) { TreeDpt.FindNode(list[i].mCode.ToString()).Checked = true; } } } }