Пример #1
0
        private void PopulateNodes2(TreeNodeCollection nodes, int parent)
        {
            ZhuJi.Portal.IDAL.IPlugin plugin = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Portal.NHibernateDAL.Plugin)) as ZhuJi.Portal.IDAL.IPlugin;
            IList<ZhuJi.Portal.Domain.Plugin> list = plugin.GetObjects();

            ZhuJi.Portal.Domain.PluginCollection plugins = new ZhuJi.Portal.Domain.PluginCollection();
            DataTable dt = plugins.CreateDateTable(list);

            DataRow[] drs = dt.Select(string.Format("[Parent] = {0}", parent));
            if (drs.Length == 0)
            {
                return;
            }
            else
            {
                foreach (DataRow dr in drs)
                {
                    TreeNode tn = new TreeNode();
                    tn.Text = dr["Title"].ToString();
                    tn.Value = dr["Id"].ToString();
                    if (dt.Select(string.Format("[Parent] = {0}", tn.Value)).Length > 0)
                    {
                        tn.PopulateOnDemand = true;
                    }
                    tn.NavigateUrl = string.Format("AddIn.aspx?PluginId={0}", dr["Id"]);
                    nodes.Add(tn);
                }
            }
        }
Пример #2
0
        private void PopulateNodes2(TreeNodeCollection nodes, int parent)
        {
            ZhuJi.Portal.IDAL.IPlugin          plugin = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Portal.NHibernateDAL.Plugin)) as ZhuJi.Portal.IDAL.IPlugin;
            IList <ZhuJi.Portal.Domain.Plugin> list   = plugin.GetObjects();

            ZhuJi.Portal.Domain.PluginCollection plugins = new ZhuJi.Portal.Domain.PluginCollection();
            DataTable dt = plugins.CreateDateTable(list);

            DataRow[] drs = dt.Select(string.Format("[Parent] = {0}", parent));
            if (drs.Length == 0)
            {
                return;
            }
            else
            {
                foreach (DataRow dr in drs)
                {
                    TreeNode tn = new TreeNode();
                    tn.Text  = dr["Title"].ToString();
                    tn.Value = dr["Id"].ToString();
                    if (dt.Select(string.Format("[Parent] = {0}", tn.Value)).Length > 0)
                    {
                        tn.PopulateOnDemand = true;
                    }
                    tn.NavigateUrl = string.Format("AddIn.aspx?PluginId={0}", dr["Id"]);
                    nodes.Add(tn);
                }
            }
        }
Пример #3
0
        /// <summary>
        /// 获取树型插件记录集合
        /// </summary>
        /// <returns>树型插件记录集合</returns>
        public IList <ZhuJi.Portal.Domain.Plugin> TreeNodes()
        {
            IList <ZhuJi.Portal.Domain.Plugin> list = session.CreateQuery("select t from Plugin t order by t.OrderBy desc,t.Id desc").List <ZhuJi.Portal.Domain.Plugin>();

            ZhuJi.Portal.Domain.PluginCollection plugins = new ZhuJi.Portal.Domain.PluginCollection();
            list = plugins.Tree(list);

            return(list);
        }
Пример #4
0
        private void PopulateNodes(TreeNodeCollection nodes, int parent)
        {
            try
            {
                ZhuJi.Portal.IDAL.IPlugin          plugin = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Portal.NHibernateDAL.Plugin)) as ZhuJi.Portal.IDAL.IPlugin;
                IList <ZhuJi.Portal.Domain.Plugin> list   = plugin.GetObjects();

                ZhuJi.Portal.Domain.PluginCollection plugins = new ZhuJi.Portal.Domain.PluginCollection();
                DataTable dt = plugins.CreateDateTable(list);

                DataRow[] drs = dt.Select(string.Format("[Parent] = {0}", parent));
                if (drs.Length == 0)
                {
                    return;
                }
                else
                {
                    foreach (DataRow dr in drs)
                    {
                        TreeNode tn = new TreeNode();
                        tn.Text  = string.Format("{0}({1})", dr["Title"].ToString(), dr["Id"].ToString());
                        tn.Value = dr["Id"].ToString();
                        if (dt.Select(string.Format("[Parent] = {0}", tn.Value)).Length > 0)
                        {
                            tn.PopulateOnDemand = true;
                        }
                        tn.SelectAction = TreeNodeSelectAction.Expand;
                        nodes.Add(tn);
                    }
                }
            }
            catch (Exception ex)
            {
                ShowMessage(ex);
            }
        }
        private void PopulateNodes(TreeNodeCollection nodes,int parent)
        {
            try
            {
                ZhuJi.Portal.IDAL.IPlugin plugin = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Portal.NHibernateDAL.Plugin)) as ZhuJi.Portal.IDAL.IPlugin;
                IList<ZhuJi.Portal.Domain.Plugin> list = plugin.GetObjects();

                ZhuJi.Portal.Domain.PluginCollection plugins = new ZhuJi.Portal.Domain.PluginCollection();
                DataTable dt = plugins.CreateDateTable(list);

                DataRow[] drs = dt.Select(string.Format("[Parent] = {0}", parent));
                if (drs.Length == 0)
                {
                    return;
                }
                else
                {
                    foreach (DataRow dr in drs)
                    {
                        TreeNode tn = new TreeNode();
                        tn.Text = string.Format("{0}({1})", dr["Title"].ToString(), dr["Id"].ToString());
                        tn.Value = dr["Id"].ToString();
                        if (dt.Select(string.Format("[Parent] = {0}", tn.Value)).Length > 0)
                        {
                            tn.PopulateOnDemand = true;
                        }
                        tn.SelectAction = TreeNodeSelectAction.Expand;
                        nodes.Add(tn);
                    }
                }
            }
            catch (Exception ex)
            {
                ShowMessage(ex);
            }
        }