private void tvType_AfterSelect(object sender, TreeViewEventArgs e) { try { if (this.tvType.SelectedNode == null) { return; } sa_t_oper_type oper_type = this.tvType.SelectedNode.Tag as sa_t_oper_type; if (oper_type.oper_type.Equals("1000")) { tsbAllCheck_Click(sender, e); } else { IBLL.ISys bll = new BLL.SysBLL(); List <sa_t_oper_grant> list = bll.GetAllGrant(new sa_t_oper_grant() { oper_id = oper_type.oper_type }); //清空选项 tsbNoCheck_Click(sender, e); list.ForEach((grant) => { string[] grants = grant.grant_string.Split(';'); foreach (string str in grants) { if (string.IsNullOrEmpty(str)) { continue; } TreeNode tn = tn_dic[grant.func_id + "_" + str]; tn.Checked = true; if (tn.Parent != null) { UpdateParentNodes(tn.Parent); } } }); } } catch (Exception ex) { MsgForm.ShowFrom(ex); } }