protected void LoadPowerData()
        {
            TreePower.Nodes.Clear();
            BLL.tPower BLL = new BLL.tPower();
            DataSet    ds  = BLL.GetAllList();

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                FineUIPro.TreeNode node = new FineUIPro.TreeNode();
                node.NodeID           = row["powerId"].ToString();
                node.Text             = row["powerName"].ToString();
                node.EnableClickEvent = true;
                node.EnableCheckBox   = true;
                node.EnableCheckEvent = true;
                TreePower.Nodes.Add(node);
            }


            if (TreeUser.SelectedNode == null)
            {
                return;
            }
            string userID = TreeUser.SelectedNodeID;

            Maticsoft.BLL.tUserPower          BLLtt = new Maticsoft.BLL.tUserPower();
            List <Maticsoft.Model.tUserPower> list  = BLLtt.GetModelList(string.Format(" userId={0}", userID));

            string[] strR = new string[list.Count];
            for (int i = 0; i < list.Count; i++)
            {
                TreePower.FindNode(list[i].powerId.ToString()).Checked = true;
            }
        }
 protected void btnNew_Click(object sender, EventArgs e)
 {
     if (txtName.Text.Trim() == "")
     {
         return;
     }
     BLL.tPower   bll = new BLL.tPower();
     Model.tPower m   = new Model.tPower();
     m.powerName = txtName.Text;
     if (bll.Add(m) > 0)
     {
         Alert.ShowInTop("添加成功!");
         LoadPowerData();
     }
 }
        protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
        {
            if (e.EventArgument == "Confirm_OK")
            {
                if (TreePower.SelectedNodeID == "")
                {
                    Alert.ShowInTop("该项操作未执行,因未选权限!"); return;
                }
                BLL.tPower bll = new BLL.tPower();

                if (bll.Delete(int.Parse(TreePower.SelectedNodeID)))
                {
                    Alert.ShowInTop("删除成功!");
                    LoadPowerData();
                }
            }
            else if (e.EventArgument == "Confirm_Cancel")
            {
                return;
            }
        }