Example #1
0
        /// <summary>
        /// 生成关联模版
        /// </summary>
        /// <param name="newsId"></param>
        public void MakeRelateTemplateTwo(string channelId, string createTime)
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("newsdate", createTime);
            HtmlServer.CreateTemplatePageByChannelId(channelId, dic);
        }
Example #2
0
        public void RelatedEmptyArticle(int newsId, string lmid, string operateType)
        {
            newsBLL.IsLm(newsId, lmid);
            News news = new News();

            news = newsBLL.Get("NewsId", newsId);
            string[] strlm;
            strlm = lmid.Split(',');
            for (var i = 0; i < strlm.Length; i++)
            {
                news.ChannelId    = strlm[i];
                news.Sort         = 2;
                news.ParentNewsId = newsId;
                news.IsRetinue    = true;
                news.TitleColor   = "#333333";
                if (!newsBLL.IsLmExist(newsId, strlm[i]))
                {
                    newsBLL.AddOrEdit(news, "add");
                }
                else
                {
                    newsBLL.AddOrEdit(news, operateType);
                }
                HtmlServer.CreateTemplatePageByChannelId(strlm[i]);
            }
        }
Example #3
0
        /// <summary>
        /// 生成关联模版
        /// </summary>
        /// <param name="newsId"></param>
        public void MakeRelateTemplate(int newsId)
        {
            News news = new News();

            news = newsBLL.Get("NewsId", newsId);
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("newsdate", news.CreatedTime.ToString());
            HtmlServer.CreateTemplatePageByChannelId(news.ChannelId, dic);
        }
Example #4
0
        public int UpdateFragment(Fragment fragment)
        {
            fragment.CreatedUser = UserCookies.AdminName;
            fragment.CreatedTime = DateTime.Now;
            int result = fragmentBLL.Add(fragment);

            //重新根据模板生成页面
            HtmlServer.CreateTemplatePageByChannelId(fragment.ChannelId);
            return(result);
        }
Example #5
0
        public string EditListNews(News news)
        {
            var channel = channelBLL.Get("ChannelId", news.ChannelId);

            if (news.ChannelId == "0" || channel == null)
            {
                return("000002");  //分类有误
            }
            int result = newsBLL.EditListNews(news);

            HtmlServer.CreateTemplatePageByChannelId(news.ChannelId);
            return(result.ToString()); //添加/修改成功
        }
Example #6
0
        public string AddEditPicArticle(News news, string operateType, string blod)
        {
            if (string.IsNullOrEmpty(news.Title))
            {
                return("000001");   //标题不能为空
            }

            var channel = channelBLL.Get("ChannelId", news.ChannelId);

            if (string.IsNullOrEmpty(news.Url))
            {
                return("000002");  //文章url不能为空
            }
            if (news.ChannelId == "0" || channel == null)
            {
                return("000003");  //分类有误
            }



            if (string.IsNullOrEmpty(blod))
            {
                news.IsBold = (0).ToString();
            }
            else
            {
                news.IsBold = (1).ToString();
            }
            if (string.IsNullOrEmpty(news.CreatedTime.ToString()))
            {
                news.CreatedTime = DateTime.Now;
            }
            if (operateType == "add")
            {
                news.OrderDay    = string.Format("{0:yyyyMMdd}", news.CreatedTime);
                news.OrderTime   = string.Format("{0:HHmmss}", news.CreatedTime);
                news.SecondUrl   = news.Url;
                news.SecondTitle = news.Title;
            }
            else
            {
                news.UpdatedTime = DateTime.Now;
            }

            int result = newsBLL.AddOrEdit(news, operateType);

            HtmlServer.CreateTemplatePageByChannelId(news.ChannelId);
            return(result.ToString()); //添加/修改成功
        }
Example #7
0
        public int UpdateFragmentBack(Fragment fragment)
        {
            fragment.UpdatedUser = UserCookies.AdminName;
            fragment.UpdatedTime = DateTime.Now;
            fragment.CreatedUser = UserCookies.AdminName;
            fragment.CreatedTime = DateTime.Now;
            if (fragment.IsDeleted == true)
            {
                fragment.DeletedUser = UserCookies.AdminName;
                fragment.DeletedTime = DateTime.Now;
            }
            int result = fragmentBLL.Update(fragment);

            //重新根据模板生成页面
            HtmlServer.CreateTemplatePageByChannelId(fragment.ChannelId);
            return(result);
        }
Example #8
0
        public string AddEditEmptyArticle(News news, string operateType, string blod)
        {
            string[] arraytitle;
            string[] arrayurl;

            if (string.IsNullOrEmpty(news.Title))
            {
                return("000001");   //标题不能为空
            }
            var channel = channelBLL.Get("ChannelId", news.ChannelId);

            if (news.ChannelId == "0" || channel == null)
            {
                return("000002");  //分类有误
            }
            arraytitle = news.Title.Split(',');
            arrayurl   = news.Url.Split(',');
            if (string.IsNullOrEmpty(news.CreatedTime.ToString()))
            {
                news.CreatedTime = DateTime.Now;
            }
            if (operateType == "add")
            {
                news.Title = arraytitle[0];
                news.Url   = arrayurl[0];
                if (string.IsNullOrEmpty(news.TitleColor))
                {
                    news.TitleColor = "";
                }
                news.OrderDay  = string.Format("{0:yyyyMMdd}", news.CreatedTime);
                news.OrderTime = string.Format("{0:HHmmss}", news.CreatedTime);
            }
            else
            {
                news.Title       = arraytitle[0];
                news.Url         = arrayurl[0];
                news.UpdatedTime = DateTime.Now;
            }
            int result = newsBLL.AddOrEdit(news, operateType);

            HtmlServer.CreateTemplatePageByChannelId(news.ChannelId);
            return(result.ToString()); //添加/修改成功
        }