public ActionResult GetNewsList() { try { NewsDAL obj = new NewsDAL(); return(Json(new { result = "success", list = obj.GetNewsList(), JsonRequestBehavior.AllowGet })); } catch (Exception ex) { WriteLogs.Write(ex); return(Json(new { result = "error" }, JsonRequestBehavior.AllowGet)); } }
/// <summary> /// 得到新闻列表 /// </summary> /// <param name="PageIndex"></param> /// <param name="PageNum"></param> /// <param name="NewsId"></param> /// <param name="Title"></param> /// <param name="Count"></param> /// <param name="olist"></param> /// <returns></returns> public string GetNewsList(int PageIndex, int PageNum, int?NewsId, string Title, out int Count, out List <NewsModel> olist) { olist = new List <NewsModel>(); Count = 0; string where = " 1=1"; if (NewsId != null) { where += " and NewsInfo.NewsId=" + NewsId.Value; } if (!String.IsNullOrEmpty(Title)) { where += " and NewsInfo.Title like '%" + Title + "%'"; } try { olist = nb.GetNewsList(PageIndex, PageNum, where, out Count); return(Config.Success); } catch (Exception ex) { WriteLog.WriteExceptionLog("NewsBLL.GetNewsList()", ex); return(Config.ExceptionMsg); } }
/// <summary> /// 获取新闻列表 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSiz"></param> /// <param name="sum"></param> /// <returns></returns> public DataTable GetNewsList(int pageIndex, int pageSiz, out int sum) { return(newsDal.GetNewsList(pageIndex, pageSiz, out sum)); }
public List <DAL.Entities.NewsDetails> GetNewsList() { return(news.GetNewsList()); }