Пример #1
0
        private void FullShowList()
        {
            BLL.Article bllarticle = new BLL.Article();
            int         rowcount, pageIndex, pageSize;

            pageIndex = 1;
            pageSize  = 15;
            string[] str     = "7".Split(',');
            int[]    typeids = new int[str.Length];
            for (int i = 0; i < str.Length; i++)
            {
                typeids[i] = Convert.ToInt32(str[i]);
            }
            DataTable     dt        = bllarticle.getPagerArticle(pageIndex, pageSize, out rowcount, typeids, "");
            int           pagecount = (rowcount + pageSize - 1) / pageSize;
            StringBuilder result    = new StringBuilder();

            foreach (DataRow dr in dt.Rows)
            {
                result.AppendFormat("<li><a href=\"javascript:showDetail({0})\" data-transition='slide'>{1}<span class=\"ui-li-count\">{2}</span></a></li>", dr["id"], dr["dbo_title"], ((DateTime)dr["dbo_ptime"]).ToString("yyyy-MM-dd"));
            }
            NewList = result.ToString();
            hidPagecount_list.Value = pagecount.ToString();
            hidPageNow_list.Value   = pageIndex.ToString();
            if (pagecount == pageIndex || pagecount == 0)
            {
                listMore.InnerHtml = "没有更多内容了";
            }
        }
Пример #2
0
        public ActionResult Create()
        {
            BLL.Article bll = new BLL.Article();
            Models.BlogCreate blogCreate = new Models.BlogCreate();

            //Models.ArticleCategory = bll.GetCategory();
            //blogCreate.Tags = bll.GetTag();

            return View();
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            b_Article = new BLL.Article();

            if (!IsPostBack)
            {
                GetArticleTXT(Article_Name);
                SetLanguageControl(Article_LanguageID);
                e_Article = b_Article.Select_Article(g_Article_ClassID, Convert.ToInt32(Article_LanguageID.SelectedValue));
                Article_Content.Value = e_Article.Article_Content;
            }
        }
Пример #4
0
        /// <summary>
        /// 执行策略
        /// </summary>
        public override void DoWork <T>(T context)
        {
            var articleContext = context as XCLCMS.Data.BLL.Strategy.Article.ArticleContext;

            if (null == articleContext.Article)
            {
                return;
            }

            bool flag = false;

            XCLCMS.Data.BLL.Article bll = new BLL.Article();

            try
            {
                switch (articleContext.HandleType)
                {
                case StrategyLib.HandleType.ADD:
                    articleContext.Article.CreaterID   = articleContext.ContextInfo.UserInfoID;
                    articleContext.Article.CreaterName = articleContext.ContextInfo.UserName;
                    articleContext.Article.CreateTime  = DateTime.Now;
                    articleContext.Article.UpdaterID   = articleContext.Article.CreaterID;
                    articleContext.Article.UpdaterName = articleContext.Article.CreaterName;
                    articleContext.Article.UpdateTime  = articleContext.Article.CreateTime;
                    flag = bll.Add(articleContext.Article);
                    break;

                case StrategyLib.HandleType.UPDATE:
                    articleContext.Article.UpdaterID   = articleContext.ContextInfo.UserInfoID;
                    articleContext.Article.UpdaterName = articleContext.ContextInfo.UserName;
                    articleContext.Article.UpdateTime  = DateTime.Now;
                    flag = bll.Update(articleContext.Article);
                    break;
                }
            }
            catch (Exception ex)
            {
                flag = false;
                this.ResultMessage += string.Format("异常信息:{0}", ex.Message);
            }

            if (flag)
            {
                this.Result = StrategyLib.ResultEnum.SUCCESS;
            }
            else
            {
                this.Result        = StrategyLib.ResultEnum.FAIL;
                this.ResultMessage = string.Format("保存文章基础信息失败!{0}", this.ResultMessage);
            }
        }
Пример #5
0
        public static Expose178.Com.Model.Article GetArticle(string strArticleID)
        {
            Article article = null;

            try
            {
                Expose178.Com.BLL.Article bllArticle = new BLL.Article();
                if (IsEnableCache)
                {
                    if (System.Web.HttpRuntime.Cache["article"] == null)
                    {
                        article = bllArticle.GetArticle(strArticleID);
                        AggregateCacheDependency dependency = Expose178.Com.CacheDependencyFactory.DependencyFacade.GetArticleDependency();
                        if (article != null)
                        {
                            System.Web.HttpRuntime.Cache.Add("article", article, dependency, DateTime.Now.AddSeconds(IntArticleDuration), System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                        }
                    }
                    else
                    {
                        article = (Expose178.Com.Model.Article)System.Web.HttpRuntime.Cache["article"];
                    }
                }
                else
                {
                    article = bllArticle.GetArticle(strArticleID);
                }
                Expose178.Com.Model.ArticleAddtional addtinal = bllArticle.GetArticleAddtional(strArticleID);
                bllArticle.UpdateArticleAddtional(addtinal);
            }
            catch (Exception ex)
            {
                Hashtable hshParam = new Hashtable();
                hshParam.Add("Error", ex.Message);
                hshParam.Add("UID", Expose178.Com.GadgetScripts.Gadget.GetUserID());
                Expose178.Com.UtilityFactory.Log.WriteLog(hshParam, "ProxyArticle.GetArticle", UtilityFactory.LogType.LogToDB);
            }

            return(article);
        }
Пример #6
0
        public string GetListByPage(string page)
        {
            BLL.Article bllarticle = new BLL.Article();
            int         rowcount, pageIndex, pageSize;

            pageIndex = Convert.ToInt32(page);
            pageSize  = 15;
            string[] str     = "7".Split(',');
            int[]    typeids = new int[str.Length];
            for (int i = 0; i < str.Length; i++)
            {
                typeids[i] = Convert.ToInt32(str[i]);
            }
            DataTable     dt     = bllarticle.getPagerArticle(pageIndex, pageSize, out rowcount, typeids, "");
            StringBuilder result = new StringBuilder();

            foreach (DataRow dr in dt.Rows)
            {
                result.AppendFormat("<li><a href=\"javascript:showDetail({0})\" data-transition='slide'>{1}<span class=\"ui-li-count\">{2}</span></a></li>", dr["id"], dr["dbo_title"], ((DateTime)dr["dbo_ptime"]).ToString("yyyy-MM-dd"));
            }
            return(result.ToString());
        }
Пример #7
0
        public ActionResult Show(int id)
        {
            BLL.Article bll = new BLL.Article();
            bll.Read(id);
            var ar = bll.GetSingle(id);
            var artleShow = new Models.BlogShow()
            {
                ArticleContent = ar.ArticleContent,
                ArticleID = ar.ArticleID,
                ArticleTitle = ar.ArticleTitle,
                AuthorName = ar.User.UserName,
                CreateDate = ar.CreateDate,
                IsTop = ar.IsTop,
                ReadNum = ar.ReadNum,
                //Replys = (from r in ar.ArticleReplies
                //         where r.Active == 1
                //         orderby r.ReplyTime descending
                //         select new ICollection<Models.BlogReplys>()
                //         {
                //             Active=r.Active,
                //             ArticleID=r.ArticleID,
                //             ArticleReplyID=r.ArticleReplyID,
                //             ReplyContent=r.ReplyContent,
                //             ReplyTime=r.ReplyTime,
                //             ReplyUserEmail=r.ReplyUserEmail,
                //             ToReplyID=r.ToReplyID,
                //             ReplyUserName=r.ReplyUserName,
                //             UserID=r.UserID,
                //             ToReplyUserName=r.ArticleReply1.ReplyUserName
                //         };)
                Replys=ar.ArticleReplies,
                Category=ar.ArticleCategories,
                Tags=ar.ArticleTags
            };

            return View(artleShow);
        }
Пример #8
0
 public static bool AddUpdateArticle(Expose178.Com.Model.Article article)
 {
     Expose178.Com.BLL.Article bllArticle = new BLL.Article();
     return(bllArticle.AddUpdateArticle(article));
 }
Пример #9
0
 public int SubmitReply()
 {
     Model.ArticleReply reply = new Model.ArticleReply()
     {
         Active = 1,
         ArticleID = Convert.ToInt32(Request.Form["ArticleID"]),
         ReplyContent = HttpContextHelper.InputText(Request.Form["ReplyContent"],4000),
         ReplyTime = DateTime.Now,
         ReplyUserEmail = HttpContextHelper.InputText(Request.Form["ReplyUserEmail"],100),
         ReplyUserName = HttpContextHelper.InputText(Request.Form["ReplyUserName"],50),
         ToReplyID = Convert.ToInt32(Request.Form["ToReplyID"]),
         UserID = 0
     };
     BLL.Article bll = new BLL.Article();
     return bll.SubmitReply(reply);
 }