Пример #1
0
        /// <summary>
        /// 获取系统搜索关键词
        /// </summary>
        /// <param name="Top"></param>
        /// <returns></returns>
        public static string getsearchkey(string Top, string ModelID)
        {
            StringBuilder sb = new StringBuilder();

            var list = SysKeywordView.GetModelList(string.Format("ModelID={0} order by ClickCount desc", ModelID), Top.ToInt32(10));

            foreach (var item in list)
            {
                sb.Append(string.Format("<a href=\"/Search.aspx?m={1}&key={0}\">{0}</a>&nbsp;", item.Keyword, ModelID));
            }
            return(sb.ToS());
        }
Пример #2
0
        public static string Getsearchkey(string m_where, int Top, string Model)
        {
            StringBuilder sb = new StringBuilder();

            var list = SysKeywordView.GetModelList(m_where, Top);

            foreach (var item in list)
            {
                string str = Model;
                str = str.Replace("{clickcount}", item.ClickCount.ToS());
                str = str.Replace("{id}", item.Id.ToS());
                str = str.Replace("{keyword}", item.Keyword);
                sb.Append(str);
            }
            return(sb.ToS());
        }
Пример #3
0
        /// <summary>
        /// 创建系统关键词
        /// </summary>
        /// <param name="ModelID"></param>
        /// <param name="key"></param>
        public static void InsertKeyWords(int ModelID, string key)
        {
            SysKeyword k = SysKeywordView.Find(string.Format("ModelID={0} and Keyword=N'{1}'", ModelID, key));

            if (k.Id <= 0)
            {
                //不存在
                k.ModelID    = ModelID;
                k.Keyword    = key;
                k.ClickCount = 0;
                SysKeywordView.Insert(k);
            }
            else
            {
                k.ClickCount++;
                SysKeywordView.Update(k);
            }
        }