示例#1
0
        /// <summary>
        /// 生成栏目页静态文件
        /// </summary>
        /// <param name="Noidlist">节点列表文件 逗号隔开</param>
        /// <param name="CreateParentID">是否生成子节点</param>
        /// <returns></returns>
        public bool CreateListFile(int nodeid)
        {
            XmlDocument xml = new XmlDocument();
            XmlNodeList xnl;

            if (nodeid > 0)
            {
                int    pid  = nll.SelFirstNodeID(nodeid);
                M_Node Pnid = nll.SelReturnModel(pid);
                if (!string.IsNullOrEmpty(Pnid.SiteConfige))
                {
                    xml.LoadXml(Pnid.SiteConfige);
                    xnl = xml.SelectNodes("SiteConfig");
                    dir = function.GetXmlNode(xnl, "TemplateDir");
                    dir = dir.Substring(1, dir.LastIndexOf("Template") - 1);
                    dir = dir.Replace(@"\", "/");
                    dir = dir.Replace("//", "/");
                    dir = "/" + dir;
                    DataTable ntable = nll.SelByIDS(this.Nodeist);//生成静态的节点
                    if (ntable != null && ntable.Rows.Count > 0)
                    {
                        SetCreateList(ntable);
                    }
                }
            }
            return(false);
        }
示例#2
0
        public bool CreateHtml(int nodeid)
        {
            M_Node Pnid = new M_Node();

            if (nodeid > 0)
            {
                int pid = nll.SelFirstNodeID(nodeid);
                Pnid = nll.SelReturnModel(pid);
                XmlDocument xml = new XmlDocument();
                xml.LoadXml(Pnid.SiteConfige);
                XmlNodeList xnl = xml.SelectNodes("SiteConfig");
                templateDir = function.GetXmlNode(xnl, "TemplateDir");
                templateDir = templateDir.Substring(1, templateDir.LastIndexOf("Template") - 1);
                templateDir = templateDir.Replace(@"\", "/");
                templateDir = templateDir.Replace("//", "/");
            }

            if (nll.SelByIDS(this.Nodeist).Rows.Count > 0)
            {
                DataTable ntable = nll.SelByIDS(this.Nodeist);
                for (int i = 0; i < ntable.Rows.Count; i++)
                {
                    string    NodeID     = ntable.Rows[i]["NodeID"].ToString();
                    DataTable GetContent = cll.GetNodeAri(DataConverter.CLng(NodeID));//ZL_CommonModel nodeid

                    for (int b = 0; b < GetContent.Rows.Count; b++)
                    {
                        int GeneralID = DataConverter.CLng(GetContent.Rows[b]["GeneralID"].ToString());

                        SetCreateContent(DataConverter.CLng(NodeID), GeneralID);
                    }
                }
            }

            return(false);
        }