/// <summary> /// 获取新闻列表 /// </summary> /// <returns></returns> public IList <NewsListModel> GetNewsList(CateType cateId, int recommend = 1) { var filed = "top 10 NewsId,Title,Img,InputTime,Summary"; var condition = "Recommend=@Recommend and CateId=@CateId"; var param = new DynamicParameters(); param.Add("Recommend", recommend); param.Add("CateId", cateId); return(GetModels <NewsListModel>(TableName, condition, param, filed)); }
public void SetCate(CateType cate) { InitialCate(); Dictionary<int, string> tmpcate = new Dictionary<int,string>(); foreach (int key in CateList.Keys) { tmpcate.Add(key, CateList[key]); if (key == (int)cate|| key==((int)cate)/10*10) { tmpcate[key] = "current"; } else { tmpcate[key] = ""; } } CateList = tmpcate; }
public void SetCate(CateType cate) { InitialCate(); Dictionary <int, string> tmpcate = new Dictionary <int, string>(); foreach (int key in CateList.Keys) { tmpcate.Add(key, CateList[key]); if (key == (int)cate || key == ((int)cate) / 10 * 10) { tmpcate[key] = "current"; } else { tmpcate[key] = ""; } } CateList = tmpcate; }
/// <summary> /// 获得动态走势列表 /// </summary> /// <param name="cateId"></param> /// <returns></returns> public ActionResult List(CateType cateId) { return(View(_newsService.GetNewsList(cateId))); }
/// <summary> /// 获取新闻列表 /// </summary> /// <returns></returns> public IList <NewsListModel> GetNewsList(CateType cateId) { return(_newsDal.GetNewsList(cateId)); }