示例#1
0
        /// <summary>
        ///  静态生成分页频道
        /// </summary>
        /// <param name="Class">频道ID</param>
        /// <param name="StaticHtmlType">频道类型 0封面 1列表+分页</param>
        /// <returns></returns>
        public static string StaticChannel(int Class, int StaticHtmlType, int page)
        {
            string ERR = null;
            bool   e1, e2 = false;

            e1 = StaticHtmlDate.StaticChannel(Class);
            if (StaticHtmlType > 0)
            {
                e2 = StaticHtmlDate.StaticChannelList(Class, page);
            }
            if (!e1)
            {
                ERR += " 静态生成频道封面失败频道编号" + Class.ToString();
            }
            if (!e2)
            {
                ERR += " 静态生成频道列表失败频道编号" + Class.ToString();
            }

            if (e1 && StaticHtmlType < 1)
            {
                ERR = " 生成频道封面成功! ";
            }

            if (((StaticHtmlType > 0) && e2))
            {
                ERR = " 生成频道列表成功! ";
            }
            return(ERR);
        }
示例#2
0
        /// <summary>
        ///  静态生成所有频道
        /// </summary>
        /// <returns></returns>
        public static string StaticAllChannel()
        {
            int     s  = 0; //成功生成个数
            int     e  = 0; //失败生成个数
            DataSet ds = new ROYcms.Sys.BLL.ROYcms_class().GetClassList();

            if (ds == null)
            {
                return("无频道");
            }
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                bool t1, t2 = false;
                t1 = StaticHtmlDate.StaticChannel(Convert.ToInt32(dr["Id"]));
                t2 = StaticHtmlDate.StaticChannelList(Convert.ToInt32(dr["Id"]), 10);
                if (t1 && t2)
                {
                    s++;
                }
                else
                {
                    e++;
                }
            }
            return("  成功生成所有频道[" + s.ToString() + "]个失败[" + e.ToString() + "]个!  ");
        }