/// <summary> /// 加载文章列表 /// </summary> /// <param name="context"></param> private void GetList(NVelocity.VelocityContext context) { sbr.Clear(); try { PageClass pc = new PageClass(); int record_cnt = 0; int page_cnt = 0; int curpage = 1; int pagesize = 49; curpage = String_Manage.Return_Request_Int("page", 1); int page = 0; if (curpage > 0) { page = curpage - 1; } string where = " and types=" + type + " and isend=0 and a.pub_state=0 and type_parent=" + type_parent + " and New_Zixun_Is_Tbk=0 "; if (season_require_id != "") { //不是包包、美妆下的数据 if (type != baobao_id && type != meizhuang_id) { ////当前显示类型是配饰 //if (type == peishi_id) //{ // //当前被设置显示的季节是四季 // if (season_require_id_linshi.IndexOf(season_siji_id_linshi) >= 0) // { // where += " and New_Zixun_Season in(" + season_require_id + ") "; // } // else//当前被设置显示的季节不是四季 // { // where += " and New_Zixun_Season in("+season_require_id+","+season_siji_id+")"; // } //} //else //{ where += " and New_Zixun_Season in(" + season_require_id + ") "; //} } } if (stype > 0) { where = " and charindex('," + stype + ",',','+New_Zixun_Idlist+',')>0 "; } //context.Put("redirecturl_error",page+"@@@@@@"+ where); ds = pc.TagList_New("*", " edittime desc ", " hrenh_article a ", where, page, pagesize, " id,title,isimg,img_url,edittime,New_Zixun_Price,New_Zixun_intro_short,isnull((select product_name from HRENH_PRODUCT_PLATINFO where id=a.product_plat_id),'') as platname,isnull((select Produce_Img from HRENH_PRODUCT_PLATINFO where id=a.product_plat_id),'') as platimg "); if (ds != null && ds.Tables[2].Rows.Count > 0) { record_cnt = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); page_cnt = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString()); for (int i = 0; i < ds.Tables[2].Rows.Count; i++) { DataRow dr = ds.Tables[2].Rows[i]; #region 文章列表的信息 int article_id = String_Manage.Return_Int(dr["id"].ToString(), 0); string article_title = String_Manage.Return_Str(dr["title"].ToString(), ""); string short_intro = String_Manage.Return_Str(dr["New_Zixun_intro_short"].ToString(), ""); if (type != 370) { if (short_intro != "") { article_title = short_intro; } } string show_article_title = StringHelper.ReturnNumStr(article_title, 0, 29); int isimg = String_Manage.Return_Int(dr["isimg"].ToString(), 0); string article_img = "/template/img/nocontent.png"; if (isimg == 1) { article_img = ImgHelper.Get_UploadImgUrl(dr["img_url"].ToString(), 1); } string article_addtime = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 1); string prices = String_Manage.Return_Str(dr["New_Zixun_Price"].ToString(), "0"); prices = Recruit_Job.Return_Money(prices, 1); //搭配栏目 if (type == 370) { type_shouzimu = ""; } string article_url = " href='/" + prname + type_shouzimu + "/show_" + article_id + ".html' target='_blank' title='" + article_title + "' "; string platname = String_Manage.Return_Str(dr["platname"].ToString(), ""); string platimg = String_Manage.Return_Str(dr["platimg"].ToString(), ""); if (platimg != "") { platimg = ImgHelper.Get_UploadImgUrl(platimg, 1); } #endregion #region 加载文章列表 sbr.AppendFormat("<dl class=\"shopone\">"); sbr.AppendFormat("<a {0}>", article_url); //sbr.AppendFormat("<dt><img src=\"{0}\" alt=\"{1}\"></dt>", article_img, article_title); sbr.AppendFormat("<dt><img src=\"{0}\" alt=\"{1}\"><img class=\"tb\" src=\"{2}\" alt=\"{3}\"></dt>", article_img, article_title, platimg, platname + "有售"); sbr.AppendFormat("<dd>"); sbr.AppendFormat("<h4>{0}</h4>", show_article_title); //if (platname != "") //{ // sbr.AppendFormat("<b title=\"{1}购买直通车\"><i class=\"sppt\"><img src=\"{2}\" alt=\"{1}\"></i><i>¥</i>{0}</b>", prices, platname, platimg); //} //else //{ // sbr.AppendFormat("<b><i>¥</i>{0}</b>",prices); //} ////sbr.AppendFormat("<div class=\"fav\"><em class=\"fav-i\"></em> <span class=\"fav-n\">1228</span> </div>"); sbr.AppendFormat("</dd>"); sbr.AppendFormat("</a>"); sbr.AppendFormat("</dl>"); #endregion } } else { sbr.Append("<div class=\"nodata\"></div>"); } if (curpage > page_cnt) { curpage = page_cnt; } if (curpage < page_cnt) { sbr.AppendFormat("<dl class=\"shopone\">"); sbr.AppendFormat("<a href=\"javascript:;\" title=\"下一页\" class=\"cat-page-next trans200\" onclick='GoPage(" + (curpage + 1) + ")'></a>"); sbr.AppendFormat("</dl>"); } context.Put("list", sbr.ToString()); context.Put("listPage", NewXzc.Common.GenerPage.pageHtml(record_cnt, pagesize, curpage, "GoPage")); } catch (Exception ex) { context.Put("redirecturl", "/404"); } }
/// <summary> /// 获取议会活动列表 /// </summary> /// <param name="context"></param> private void GetList(NVelocity.VelocityContext context) { sbr.Clear(); PageClass pc = new PageClass(); int record_cnt = 0; int page_cnt = 0; int curpage = 1; int pagesize = 10; curpage = String_Manage.Return_Request_Int("page", 1); int page = 0; if (curpage > 0) { page = curpage - 1; } string where = " and (types=" + type + " or types_pid=" + type + ") and isend=0 and a.pub_state=0 "; if (stype > 0) { where = " and types=" + stype + " and isend=0 "; } context.Put("stype", stype); ds = pc.TagList_New("*", " istop desc,edittime desc ", " hrenh_article a ", where, page, pagesize, " id,title,isimg,img_url,contents,(isnull(read_cnt,0)+FALSH_READ_CNT) as read_cnt,isnull((select count(*) from hrenh_article_REVIEW_REPLY where article_id=a.id and reply_id=0),0) as review_cnt,edittime "); if (ds != null && ds.Tables[2].Rows.Count > 0) { record_cnt = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); page_cnt = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString()); for (int i = 0; i < ds.Tables[2].Rows.Count; i++) { DataRow dr = ds.Tables[2].Rows[i]; #region 文章列表的信息 int article_id = String_Manage.Return_Int(dr["id"].ToString(), 0); string article_title = String_Manage.Return_Str(dr["title"].ToString(), ""); string show_article_title = StringHelper.ReturnNumStr(article_title, 0, 36); int isimg = String_Manage.Return_Int(dr["isimg"].ToString(), 0); string article_img = "/template/img/nocontent.png"; if (isimg == 1) { article_img = ImgHelper.Get_UploadImgUrl(dr["img_url"].ToString(), 1); } string article_contents = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 76); string article_contents_noimg = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 170); string article_addtime = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 1); int read_cnt = String_Manage.Return_Int(dr["read_cnt"].ToString(), 0); int review_cnt = String_Manage.Return_Int(dr["review_cnt"].ToString(), 0); string article_url = "href=\"/article_detail_" + article_id + "\" target=\"_blank\" title=\"" + article_title + "\""; string parent_type_url = ArticleHelper.Get_Nav_Type_Name(type); string surl = parent_type_url + "/detail"; //if (stype >= 359 && stype <= 362) //{ // surl = "zhinan/"; // switch (stype) // { // case 359: // surl += "clys"; // break; // case 360: // surl += "fzdp"; // break; // case 361: // surl += "hzjq"; // break; // case 362: // surl += "hdth"; // break; // case 369: // surl += "psdp"; // break; // } // surl += "/show"; //} surl += "_" + article_id + ".html"; article_url = "href=\"/" + surl + "\" target=\"_blank\" title=\"" + article_title + "\""; #endregion #region 加载文章列表 sbr.AppendFormat("<li>"); sbr.AppendFormat("<dl>"); //if (isimg == 1) //{ sbr.AppendFormat("<dt><a {0}><img src=\"{1}\" alt=\"{2}\"></a></dt>", article_url, article_img, article_title); //} sbr.AppendFormat("<dd style=\"position:absolute;left:0;top:20px;left:336px;max-height:69px;\">"); string static_class = ""; //if (isimg != 1) //{ // //static_class = "style=\"position:static;\""; // article_contents = article_contents_noimg; //} sbr.AppendFormat("<h4 {2} style=\"position:static;\"><a {0}>{1}</a></h4>", article_url, show_article_title, static_class); sbr.AppendFormat("<p class=\"list-content\" {2} style=\"position:static;\"><a {0}> {1}</a></p>", article_url, article_contents, static_class); sbr.AppendFormat("<p style=\"position:relative;background:url('/template/img/clock.png') no-repeat left center;\">"); //sbr.AppendFormat("<span style=\"margin-left:0px;\">网络红人</span>"); //sbr.AppendFormat("<span class=\"mar12\">国家运动员</span>"); //sbr.AppendFormat("<span>网络红人</span>"); sbr.AppendFormat("<span style=\"border:0;margin-left:0px;color:#999;padding-left:20px;\" >{0}</span>", article_addtime); sbr.AppendFormat("<i style=\"position:absolute; right: -20px;top: 13px;\">{0}人阅</i>", read_cnt); sbr.AppendFormat("</p>"); sbr.AppendFormat("</dd>"); sbr.AppendFormat("</dl>"); sbr.AppendFormat("</li>"); #endregion } } else { sbr.Append("<div class=\"nodata\">没有找到相关数据</div>"); } if (curpage > page_cnt) { curpage = page_cnt; } context.Put("list", sbr.ToString()); context.Put("listPage", NewXzc.Common.GenerPage.pageHtml(record_cnt, pagesize, curpage, "GoPage")); }
/// <summary> /// 获取文章详情 /// </summary> /// <param name="context"></param> private void GetDetail(NVelocity.VelocityContext context) { sbr.Clear(); context.Put("id", articleid); string ishave_rcode = "0"; string result = "ok"; if (articleid == 0) { context.Put("redirecturl", "/404"); } else { try { ds = DbHelperSQL.Query("select top 1 id,title,isimg,img_url,isnull((select contents from hrenh_article_html where article_id=a.id),'') as contents,edittime,types,isnull(keywords,'文章详情') as keywords,isnull(description,'文章详情') as description,isnull((select top 1 uname from hrenh_article_author where id=a.AuthorId),'') as author,isnull((select top 1 USER_HEAD from hrenh_article_author where id=a.AuthorId),'') as uhead,New_Zixun_Tbk_Url,New_Zixun_Price,New_Zixun_Intro_Short,New_Zixun_Idlist,isnull((select product_name from HRENH_PRODUCT_PLATINFO where id=a.product_plat_id),'') as platname,isnull((select Produce_Img from HRENH_PRODUCT_PLATINFO where id=a.product_plat_id),'') as platimg from hrenh_article a where id=" + articleid + " ");// and a.pub_state=0 if (ds != null && ds.Tables[0].Rows.Count > 0) { DbHelperSQL.ExecuteSql("update hrenh_article set read_cnt=read_cnt+1 where id=" + articleid + ""); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr = ds.Tables[0].Rows[i]; #region 文章详情的信息 int article_id = String_Manage.Return_Int(dr["id"].ToString(), 0); string article_title = dr["title"].ToString(); context.Put("atitle", article_title); type = String_Manage.Return_Int(dr["types"].ToString(), -1); if (type == 6) { context.Put("title", StringHelper.ReturnNumStr(article_title, 1, 0) + "-衣品搭配网|女装穿衣搭配"); } else { context.Put("title", StringHelper.ReturnNumStr(article_title, 0, 0) + "-衣品搭配网|女装穿衣搭配"); } //context.Put("navurl", "/" + ArticleHelper.Get_Nav_Type_Name(type)); //context.Put("navnames", ArticleHelper.Get_Type_Name(type)); string article_contents = dr["contents"].ToString(); string article_addtime = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 0); string New_Zixun_Tbk_Url = dr["New_Zixun_Tbk_Url"].ToString(); string New_Zixun_Price = dr["New_Zixun_Price"].ToString(); New_Zixun_Price = Recruit_Job.Return_Money(New_Zixun_Price, 1); string author = String_Manage.Return_Str(dr["author"].ToString(), ""); string New_Zixun_Intro_Short = String_Manage.Return_Str(dr["New_Zixun_Intro_Short"].ToString(), ""); string New_Zixun_Idlist = String_Manage.Return_Str(dr["New_Zixun_Idlist"].ToString(), ""); string keywords_detail = dr["keywords"].ToString(); string description_detail = dr["description"].ToString(); description_detail = StringHelper.ReturnNumStr(article_contents, 1, 110); if (New_Zixun_Idlist != "") { keywords_detail = TypeHelper.Get_type_New_Zixun__name(New_Zixun_Idlist); Get_type_New_Zixun__name(New_Zixun_Idlist, context); } context.Put("keywords", keywords_detail); context.Put("description", description_detail); string platname = String_Manage.Return_Str(dr["platname"].ToString(), ""); string platimg = String_Manage.Return_Str(dr["platimg"].ToString(), ""); if (platimg != "") { platimg = ImgHelper.Get_UploadImgUrl(platimg, 1); } #endregion #region 加载文章详情 sbr.AppendFormat("<div class=\"portrait-header newportrait\">"); sbr.AppendFormat("<h1>{0}</h1>", article_title); sbr.AppendFormat("<p class=\"clearfix\">"); if (author != "") { sbr.AppendFormat("<em class=\"pic\"><img src=\"{0}\" alt=\"{1}\"></em>", ImgHelper.GetCofigShowUrl() + dr["uhead"].ToString(), author); sbr.AppendFormat("<em>编辑:<i>{0}</i></em>", author); //sbr.AppendFormat("<em style=\"margin-left:53px\">{0}</em>", article_addtime); } //else //{ // sbr.AppendFormat("<em style=\"margin-left:0\">{0}</em>", article_addtime); //} sbr.AppendFormat("<span class=\"org\"><i>{0}</i>来源于:<a href=\"http://www.ypindapei.com/\" title=\"衣品搭配\" target=\"_blank\">衣品搭配</a></span>", article_addtime); sbr.AppendFormat("<span>"); //sbr.AppendFormat("<span class=\"comment-sum\"><b>{0}</b> 评论</span>", review_cnt); //sbr.AppendFormat("<span><b></b>分享</span>"); sbr.AppendFormat("<span>"); sbr.AppendFormat("分享:<span class=\"bdsharebuttonbox\" id=\"share\" style=\"float: right;\"><a href=\"#\" class=\"bds_weixin\" data-cmd=\"weixin\" title=\"分享到微信\"></a><a href=\"#\" class=\"bds_tsina\" data-cmd=\"tsina\" title=\"分享到新浪微博\"></a><a href=\"#\" class=\"bds_qzone\" data-cmd=\"qzone\" title=\"分享到QQ空间\"></a></span>"); sbr.AppendFormat("</span>"); sbr.AppendFormat("</span>"); sbr.AppendFormat("</p>"); //sbr.AppendFormat("</div>"); //sbr.AppendFormat("<div class=\"hren-header\">"); //sbr.AppendFormat("<span class=\"cbhren\">唱吧红人</span>"); //sbr.AppendFormat("<span class=\"hrenID\">ID:<em>SHL-123456789</em></span>"); //sbr.AppendFormat("<span class=\"hrenfans\">唱吧粉丝:<em>33万</em></span>"); //sbr.AppendFormat("<span class=\"hrentx\"><img src=\"http://e.hiphotos.baidu.com/baike/w%3D268%3Bg%3D0/sign=52775554b6003af34dbadb660d11a161/d50735fae6cd7b89faf58fde0f2442a7d8330ed5.jpg\"></span>"); //sbr.AppendFormat("<span class=\"hrenfonc\">关注:34</span>"); //sbr.AppendFormat("<span class=\"hrenfc\">粉丝:16334</span>"); //sbr.AppendFormat("<span class=\"hrenName\">魏道道</span>"); //sbr.AppendFormat("<span class=\"hrenloc\">来自:<em>北京</em><em>北京</em><em>朝阳区</em></span>"); //sbr.AppendFormat("<a class=\"hrenfasixin\"><img src=\"/template/img/fasixin.jpg\"></a>"); //sbr.AppendFormat("<a class=\"hrenjiaguanzhu\"><img src=\"template/img/jiaguanzhu.jpg\"></a>"); sbr.AppendFormat("</div>"); sbr.AppendFormat("<div class=\"main-content-body\">"); #region 加载新说明 if (New_Zixun_Intro_Short != "") { sbr.AppendFormat("<div class=\"double_quotes\">"); sbr.AppendFormat("<div>{0}</div>", New_Zixun_Intro_Short); sbr.AppendFormat("</div>"); } #endregion article_contents = article_contents.Replace("<img", "<img alt='衣品搭配'").Replace("undefined", ""); //将A标签下的href替换成javascript:; article_contents = Get_A_Href.get_a_info(article_contents); sbr.AppendFormat("{0}", article_contents); sbr.AppendFormat("</div>"); //sbr.AppendFormat("<p class=\"gobuy\"><b>¥{0}</b></p>", New_Zixun_Price); if (New_Zixun_Tbk_Url != "") { New_Zixun_Tbk_Url = "/rfzdp/" + articleid + ".html"; if (platname != "") { //sbr.AppendFormat("<p class=\"gobuy\"><b>¥{0}</b><span><a href=\"{1}\" title='购买' target='_blank' rel=\"nofollow\">点击这里去“<strong>{3}</strong>”购买</a><i class=\"sppt\"><img src=\"{2}\" alt=\"{3}\"></i></span></p>", New_Zixun_Price, New_Zixun_Tbk_Url, platimg, platname); sbr.AppendFormat("<p class=\"gobuy\"><b>¥{0}</b><span><a href=\"{1}\" title='购买' target='_blank' rel=\"nofollow\">点击这里去购买</a><i class=\"sppt\"><img src=\"{2}\" alt=\"{3}\"></i></span></p>", New_Zixun_Price, New_Zixun_Tbk_Url, platimg, platname); } else { sbr.AppendFormat("<p class=\"gobuy\"><b>¥{0}</b><a href=\"{1}\" title='购买' target='_blank' rel=\"nofollow\">点击这里去购买</a></p>", New_Zixun_Price, New_Zixun_Tbk_Url); } } #endregion } } else { result = "no"; sbr.Append("<div class=\"nodata\">没有找到相关数据</div>"); } } catch (Exception ex) { sbr.Append(ex.ToString()); } if (type == 6) { result = "no"; } context.Put("detail", sbr.ToString()); context.Put("result", result); ////获取当前文章所在类型的最新的几篇文章 //GetList(context); //获取相关搭配推荐 Get_Top10_Zixun(context); //获取去这里选更多 Get_Top5_Zixun(context); //获取更多穿搭推荐 Get_Top20_Zixun(context); } }
/// <summary> /// 获取当前文章所在类型的最新的几篇文章 /// </summary> /// <param name="context"></param> private void GetList(NVelocity.VelocityContext context) { sbr.Clear(); StringBuilder listsbr = new StringBuilder(); int pagesize = 10; string where = " types=" + type + " and isend=0 and pub_state=0 "; if (season_require_id != "") { #region 根据季节显示文章列表 string season_where = ""; if (season_require_id != "" && season_require_id != ",,") { season_where = " and ("; string[] sarr = season_require_id.Split(','); for (int s = 0; s < sarr.Length; s++) { string nseasonid = sarr[s]; if (nseasonid != "") { season_where += "or charindex('," + nseasonid + ",',','+New_Zixun_Season+',')>0 "; } } season_where = season_where.Replace("(or", "("); season_where += ")"; } if (season_where.IndexOf("charindex") > 0) { where += season_where; } #endregion } where += " and id<>" + articleid; string sql = "select top " + pagesize + " id,title,isimg,img_url,contents,edittime,(isnull(read_cnt,0)+FALSH_READ_CNT) as read_cnt from hrenh_article where " + where + "order by istop desc,edittime desc"; ds = DbHelperSQL.Query(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr = ds.Tables[0].Rows[i]; #region 文章列表的信息 int article_id = String_Manage.Return_Int(dr["id"].ToString(), 0); string article_title = String_Manage.Return_Str(dr["title"].ToString(), ""); string show_article_title = StringHelper.ReturnNumStr(article_title, 1, 34); int isimg = String_Manage.Return_Int(dr["isimg"].ToString(), 0); string article_img = "/template/img/nocontent.png"; if (isimg == 1) { article_img = ImgHelper.Get_UploadImgUrl(dr["img_url"].ToString(), 1); } string article_contents = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 102); string article_contents_noimg = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 170); string article_addtime = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 1); string article_url = "href=\"" + navurl + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\""; int read_cnt = String_Manage.Return_Int(dr["read_cnt"].ToString(), 0); string platname = String_Manage.Return_Str(dr["platname"].ToString(), ""); string platimg = String_Manage.Return_Str(dr["platimg"].ToString(), ""); if (platimg != "") { platimg = ImgHelper.Get_UploadImgUrl(platimg, 1); } #endregion #region 加载文章列表 if (i < 3) { if (i == 0) { sbr.AppendFormat("<li class=\"mar0\">"); } else { sbr.AppendFormat("<li>"); } sbr.AppendFormat("<span>{0}</span>", article_addtime); sbr.AppendFormat("<a {0}>{1}</a>", article_url, show_article_title); sbr.AppendFormat("</li>"); } else { show_article_title = StringHelper.ReturnNumStr(article_title, 1, 18); listsbr.AppendFormat("<dl class=\"claint-main-list\">"); listsbr.AppendFormat("<dt><a {0}><img src=\"{1}\" alt=\"{2}\"></a></dt>", article_url, article_img, article_title); listsbr.AppendFormat("<dd>"); listsbr.AppendFormat("<h3><a {0}>{1}</a></h3>", article_url, show_article_title); listsbr.AppendFormat("<p><a {0}>{1}</a></p>", article_url, article_contents); //listsbr.AppendFormat("<span><i class=\"mar0\">网络红人</i><i>国家运动员</i><i>网络红人</i></span>"); listsbr.AppendFormat("<span style=\"border:0;margin-left:0px;color:#999;font-size:12px;\" >{0}<i style=\"position:absolute; right: -20px;top: -3px;color:#999;border:none;\">{1}人阅</i></span>", article_addtime, read_cnt); //listsbr.AppendFormat("<i style=\"position:absolute; right: -20px;top: 13px;\">{0}人阅</i>", read_cnt); listsbr.AppendFormat("</dd>"); listsbr.AppendFormat("</dl>"); } #endregion } } else { sbr.Append("<div class=\"nodata\">没有找到相关数据</div>"); } context.Put("list3", sbr.ToString()); context.Put("list_more", listsbr.ToString()); }
/// <summary> /// 更新当前众筹结果 /// </summary> /// <param name="zcid">众筹ID</param> /// <param name="type">ID类型,0:众筹ID,1:支持ID</param> public static void Update_ZC_State(int zcid, int type) { string tabname = " HRENH_CROWDFUNDING_INFO a "; string coloum = " a.TOTAL_MONEY,a.ENDTIME,isnull((select SUM(MONEY) from HRENH_SUPPORT_USER_RECHARGE_RECORD where SUPPORT_ID in(select ID from HRENH_SUPPORT_TYPE_INFO where CROWD_ID=a.ID) and State=2),0) as get_money "; string where = " a.id=" + zcid + " "; if (type == 1) { where = " a.id in(select top 1 crowd_id from HRENH_SUPPORT_TYPE_INFO where id=" + zcid + ") "; } string sql = "select" + coloum + "from " + tabname + " where" + where; try { DataSet ds = DbHelperSQL.Query(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { string endtime = TimeParser.ReturnCurTime(dr["endtime"].ToString(), 0); string total_money = String_Manage.Return_Str(dr["total_money"].ToString(), "0"); string get_money = String_Manage.Return_Str(dr["get_money"].ToString(), "0"); DateTime now = Convert.ToDateTime(DateTime.Now.ToShortDateString()); TimeSpan ts = Convert.ToDateTime(endtime) - now; int results = 0; int leave_days = 0; decimal tmoney = Convert.ToDecimal(total_money); decimal gmoney = Convert.ToDecimal(get_money); if (ts.Days > 0) { if (gmoney >= tmoney) { results = 2; } else { results = 1; } endtime = ts.Days.ToString(); leave_days = ts.Days; } else { if (gmoney >= tmoney) { results = 2; } else { results = 3; } } #region 更新当前众筹结果 try { if (results > 0) { DbHelperSQL.ExecuteSql("update HRENH_CROWDFUNDING_INFO set results=" + results + " where id=" + zcid); } } catch (Exception ex) { } #endregion } } } catch (Exception ex) { } }
/// <summary> /// 相关阅读 /// </summary> /// <param name="context"></param> public void Init_Xgyd(NVelocity.VelocityContext context) { StringBuilder sbr = new StringBuilder(); DataSet ds = null; int pid = 1300; try { ds = recommend_bll.GetList_NewIndex(4, " pageid=" + pid + " and cid=1010 "); if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr = ds.Tables[0].Rows[i]; string desc = StringHelper.ReturnNumStr(dr["v2"].ToString(), 0, 80); string title = ""; int isimg = 0; string imgurl = "/template/img/nocontent.png"; string addtime = ""; string httpurl = String_Manage.Return_Str(dr["url"].ToString(), ""); //链接打开方式,1:在本页面打,2:在新页面打开 int openstyle = String_Manage.Return_Int(dr["v4"].ToString(), 0); try { DataSet ads = DbHelperSQL.Query("select top 1 title,isimg,img_url,addtime from hrenh_article where id=" + desc + " and pub_state=0"); if (ads != null && ads.Tables[0].Rows.Count > 0) { for (int j = 0; j < ads.Tables[0].Rows.Count; j++) { DataRow adr = ads.Tables[0].Rows[j]; title = adr["title"].ToString(); isimg = String_Manage.Return_Int(adr["isimg"].ToString(), 0); if (isimg == 1) { imgurl = ImgHelper.Get_UploadImgUrl(adr["img_url"].ToString(), 1); } addtime = TimeParser.ReturnCurTime(adr["addtime"].ToString(), 4); } } } catch (Exception ex) { } title = StringHelper.ReturnNumStr(title, 0, 0); string show_title = StringHelper.ReturnNumStr(title, 1, 38); string width_height = "height=\"60\" width=\"90\""; sbr.AppendFormat("<li>"); sbr.AppendFormat("<em></em>"); sbr.AppendFormat("<a {1} title=\"{0}\">", title, Return_HttpURL.Return_Url(httpurl, openstyle)); sbr.AppendFormat("{0}", show_title); sbr.AppendFormat("</a>"); sbr.AppendFormat("<span>{0}</span>", addtime); sbr.AppendFormat("</li>"); } } else { sbr.Append("<div class=\"nodata\">没有找到相关数据</div>"); } } catch (Exception ex) { sbr.AppendFormat(ex.ToString()); } context.Put("xgyd", sbr.ToString()); }
/// <summary> /// 获取指南栏目下最新的10条记录 /// </summary> /// <param name="context"></param> private void GetList(NVelocity.VelocityContext context) { StringBuilder listsbr = new StringBuilder(); int pagesize = 10; int zhinan_type = 354; string where = " (types=" + zhinan_type + " or types_pid=" + zhinan_type + ") and isend=0 and pub_state=0 "; where += " and id<>" + articleid; string sql = "select top " + pagesize + " id,title,isimg,img_url,contents,edittime,(isnull(read_cnt,0)+FALSH_READ_CNT) as read_cnt from hrenh_article where " + where + "order by istop desc,edittime desc"; ds = DbHelperSQL.Query(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr = ds.Tables[0].Rows[i]; #region 文章列表的信息 int article_id = String_Manage.Return_Int(dr["id"].ToString(), 0); string article_title = String_Manage.Return_Str(dr["title"].ToString(), ""); string show_article_title = StringHelper.ReturnNumStr(article_title, 1, 34); int isimg = String_Manage.Return_Int(dr["isimg"].ToString(), 0); string article_img = "/template/img/nocontent.png"; if (isimg == 1) { article_img = ImgHelper.Get_UploadImgUrl(dr["img_url"].ToString(), 1); } string article_contents = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 102); string article_contents_noimg = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 170); string article_addtime = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 1); string article_url = "href=\"/article_detail_" + article_id + "\" target=\"_blank\" title=\"" + article_title + "\""; article_url = "href=\"/zhinan/detail_" + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\""; int read_cnt = String_Manage.Return_Int(dr["read_cnt"].ToString(), 0); #endregion #region 加载文章列表 show_article_title = StringHelper.ReturnNumStr(article_title, 1, 18); listsbr.AppendFormat("<dl class=\"claint-main-list\">"); listsbr.AppendFormat("<dt><a {0}><img src=\"{1}\" alt=\"{2}\"></a></dt>", article_url, article_img, article_title); listsbr.AppendFormat("<dd>"); listsbr.AppendFormat("<h3><a {0}>{1}</a></h3>", article_url, show_article_title); listsbr.AppendFormat("<p><a {0}>{1}</a></p>", article_url, article_contents); //listsbr.AppendFormat("<span><i class=\"mar0\">网络红人</i><i>国家运动员</i><i>网络红人</i></span>"); listsbr.AppendFormat("<span style=\"border:0;margin-left:0px;color:#999;font-size:12px;\" >{0}<i style=\"position:absolute; right: -20px;top: -3px;color:#999;border:none;\">{1}人阅</i></span>", article_addtime, read_cnt); //listsbr.AppendFormat("<i style=\"position:absolute; right: -20px;top: 13px;\">{0}人阅</i>", read_cnt); listsbr.AppendFormat("</dd>"); listsbr.AppendFormat("</dl>"); #endregion } } else { //listsbr.Append("<div class=\"nodata\">没有找到相关数据</div>"); } context.Put("list_more", listsbr.ToString()); }
/// <summary> /// 获取第一页的评论的内容 /// </summary> /// <returns></returns> private void GetReviewContent(NVelocity.VelocityContext context) { sbr.Clear(); PageClass pc = new PageClass(); DataSet reply_ds = null; int record_cnt = 0; int page_cnt = 0; int curpage = 0; int pagesize = 10; ds = pc.TagList_New("*", " review_addtime desc ", " hrenh_review_reply_article ", " and reply_id=0 and islike=0 and article_id=" + articleid + " ", curpage, pagesize, " id,userid,review_uname,review_user_head,review_contents,review_addtime,like_cnt "); if (ds != null && ds.Tables[2].Rows.Count > 0) { record_cnt = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); page_cnt = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString()); for (int i = 0; i < ds.Tables[2].Rows.Count; i++) { DataRow dr = ds.Tables[2].Rows[i]; #region 评论内容的信息 int pid = String_Manage.Return_Int(dr["id"].ToString(), 0); int puserid = String_Manage.Return_Int(dr["userid"].ToString(), 0); string uname = String_Manage.Return_Str(dr["review_uname"].ToString(), ""); string show_name = StringHelper.ReturnNumStr(uname, 0, 20); string user_head = ImgHelper.Return_User_Head(dr["review_user_head"].ToString(), 2); string contents = String_Manage.Return_Str(dr["review_contents"].ToString(), ""); string addtime = dr["review_addtime"].ToString(); addtime = TimeParser.ReturnCurTime(addtime, 1); string is_href = "href=\"javascript:void(0)\""; string width_height = "height=\"48\" width=\"48\""; int like_cnt = String_Manage.Return_Int(dr["like_cnt"].ToString(), 0); int is_like_own = review_bll.GetRecordCount(" reply_id=" + pid + " and userid=" + UserID_HongRenHui + " and islike=1 "); #endregion #region 加载评论及回复的内容 sbr.AppendFormat("<div class=\"activity-details-discuss-item clearfix\">"); sbr.AppendFormat("<a class=\"item-photo\" {0} title=\"{1}\">", is_href, uname); sbr.AppendFormat("<img src=\"{0}\" {1} alt=\"{2}\">", user_head, width_height, uname); sbr.AppendFormat("</a>"); sbr.AppendFormat("<div class=\"item-content\">"); sbr.AppendFormat("<h3>"); sbr.AppendFormat("<a {0} title=\"{1}\">{2}</a>", is_href, uname, show_name); sbr.AppendFormat("<em>{0}</em>", addtime); sbr.AppendFormat("</h3>"); sbr.AppendFormat("<p>{0}</p>", contents); sbr.AppendFormat("<p class=\"item-btns\">"); if (is_like_own == 0) { sbr.AppendFormat("<a class=\"laud laud_up\" href=\"javascript: void(0);\">{0}</a>", like_cnt); } else { sbr.AppendFormat("<a class=\"laud laud_up lauded\" href=\"javascript: void(0);\">{0}</a>", like_cnt); } if (UserID_HongRenHui == puserid) { sbr.AppendFormat("<a class=\"reply_report\" href=\"javascript: void(0);\">举报</a>"); sbr.AppendFormat("<a class=\"reply_del\" href=\"javascript: void(0);\">删除</a>"); } else { sbr.AppendFormat("<a class=\"reply_report\" href=\"javascript: void(0);\">举报</a>"); sbr.AppendFormat("<a class=\"reply_article\" href=\"javascript: void(0);\">回复</a>"); } sbr.AppendFormat("</p>"); #region 加载回复的列表 reply_ds = DbHelperSQL.Query("select * from hrenh_review_reply_article where review_pid=" + pid + " and islike=0 "); if (reply_ds != null & reply_ds.Tables[0].Rows.Count > 0) { for (int j = 0; j < reply_ds.Tables[0].Rows.Count; j++) { DataRow rdr = reply_ds.Tables[0].Rows[j]; #region 回复的内容的信息 int id = String_Manage.Return_Int(rdr["id"].ToString(), 0); int reply_userid = String_Manage.Return_Int(rdr["userid"].ToString(), 0); string reply_uname = String_Manage.Return_Str(rdr["review_uname"].ToString(), ""); string reply_show_name = StringHelper.ReturnNumStr(reply_uname, 0, 20); user_head = ImgHelper.Return_User_Head(rdr["review_user_head"].ToString(), 2); string reply_contents = String_Manage.Return_Str(rdr["review_contents"].ToString(), ""); string reply_addtime = rdr["review_addtime"].ToString(); reply_addtime = TimeParser.ReturnCurTime(reply_addtime, 1); like_cnt = String_Manage.Return_Int(rdr["like_cnt"].ToString(), 0); is_like_own = review_bll.GetRecordCount(" reply_id=" + id + " and userid=" + UserID_HongRenHui + " and islike=1 "); #endregion sbr.AppendFormat("<div class=\"activity-details-discuss-item clearfix\">"); sbr.AppendFormat("<a class=\"item-photo\" {0} title=\"{1}\"s>", is_href, reply_uname); sbr.AppendFormat("<img src=\"{0}\" {1} alt=\"{2}\">", user_head, width_height, reply_uname); sbr.AppendFormat("</a>"); sbr.AppendFormat("<div class=\"item-content\">"); sbr.AppendFormat("<h3>"); sbr.AppendFormat("<a {0} title=\"{1}\">{2}</a>", is_href, reply_uname, reply_show_name); sbr.AppendFormat("<em>{0}</em>", reply_addtime); sbr.AppendFormat("</h3>"); sbr.AppendFormat("<p>{0}</p>", reply_contents); sbr.AppendFormat("<p class=\"item-btns\">"); if (is_like_own == 0) { sbr.AppendFormat("<a class=\"laud laud_under\" href=\"javascript: void(0);\">{0}</a>", like_cnt); } else { sbr.AppendFormat("<a class=\"laud laud_under lauded\" href=\"javascript: void(0);\">{0}</a>", like_cnt); } if (UserID_HongRenHui == reply_userid) { sbr.AppendFormat("<a class=\"reply_under_report\" href=\"javascript: void(0);\">举报</a>"); sbr.AppendFormat("<a class=\"reply_under_del\" href=\"javascript: void(0);\">删除</a>"); } else { sbr.AppendFormat("<a class=\"reply_under_report\" href=\"javascript: void(0);\">举报</a>"); sbr.AppendFormat("<a class=\"reply_under_article\" href=\"javascript: void(0);\">回复</a>"); } sbr.AppendFormat("</p>"); sbr.AppendFormat("<input type=\"hidden\" class=\"hidval\" data-id=\"{0}\" data-type=\"{1}\" data-pid=\"{2}\">", id, type, pid); sbr.AppendFormat("</div>"); sbr.AppendFormat("</div>"); } } #endregion sbr.AppendFormat("<input type=\"hidden\" class=\"hidval_first\" data-id=\"{0}\" data-type=\"{1}\" data-pid=\"{2}\">", pid, type, pid); sbr.AppendFormat("</div>"); sbr.AppendFormat("</div>"); #endregion } } else { //sbr.Append("<div class=\"nodata\">没有找到相关数据</div>"); sbr.Append(""); } int cpage = curpage + 1; if (cpage > page_cnt) { cpage = page_cnt; } context.Put("reviewcontent", sbr.ToString()); context.Put("listPage", NewXzc.Common.GenerPage.pageHtml(record_cnt, pagesize, cpage)); }
/// <summary> /// 获取文章详情 /// </summary> /// <param name="context"></param> private void GetDetail(NVelocity.VelocityContext context) { sbr.Clear(); context.Put("id", articleid); string ishave_rcode = "0"; string result = "ok"; if (articleid == 0) { context.Put("redirecturl", "/404"); } else { try { ds = DbHelperSQL.Query("select top 1 id,title,isimg,img_url,isnull((select contents from hrenh_article_html where article_id=a.id),'') as contents,(isnull(read_cnt,0)+FALSH_READ_CNT) as read_cnt,isnull((select count(*) from hrenh_article_REVIEW_REPLY where article_id=a.id and reply_id=0),0) as review_cnt,edittime,types,isnull(vurl,'') as video_url,isnull(keywords,'文章详情') as keywords,isnull(description,'文章详情') as description,isnull((select top 1 uname from hrenh_article_author where id=a.AuthorId),'') as author,isnull((select top 1 USER_HEAD from hrenh_article_author where id=a.AuthorId),'') as uhead from hrenh_article a where id=" + articleid + " ");// and a.pub_state=0 if (ds != null && ds.Tables[0].Rows.Count > 0) { DbHelperSQL.ExecuteSql("update hrenh_article set read_cnt=read_cnt+1 where id=" + articleid + ""); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr = ds.Tables[0].Rows[i]; #region 文章详情的信息 int article_id = String_Manage.Return_Int(dr["id"].ToString(), 0); string article_title = dr["title"].ToString(); context.Put("atitle", article_title); type = String_Manage.Return_Int(dr["types"].ToString(), -1); if (type == 6) { context.Put("title", StringHelper.ReturnNumStr(article_title, 1, 0) + "-衣品搭配网|女装穿衣搭配"); } else { context.Put("title", StringHelper.ReturnNumStr(article_title, 0, 0) + "-衣品搭配网|女装穿衣搭配"); } //context.Put("navurl", "/" + ArticleHelper.Get_Nav_Type_Name(type)); //context.Put("navnames", ArticleHelper.Get_Type_Name(type)); string article_contents = dr["contents"].ToString(); string article_addtime = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 0); int read_cnt = String_Manage.Return_Int(dr["read_cnt"].ToString(), 0) + 1; int review_cnt = String_Manage.Return_Int(dr["review_cnt"].ToString(), 0); //视频地址 string video_url = String_Manage.Return_Str(dr["video_url"].ToString(), ""); context.Put("keywords", dr["keywords"].ToString()); context.Put("description", dr["description"].ToString()); string author = String_Manage.Return_Str(dr["author"].ToString(), ""); #endregion #region 加载文章详情 sbr.AppendFormat("<div class=\"portrait-header newportrait\">"); sbr.AppendFormat("<h1>{0}</h1>", article_title); sbr.AppendFormat("<p class=\"clearfix\">"); if (author != "") { sbr.AppendFormat("<em class=\"pic\"><img src=\"{0}\" alt=\"{1}\"></em>", ImgHelper.GetCofigShowUrl() + dr["uhead"].ToString(), author); sbr.AppendFormat("<em>编辑:<i>{0}</i></em>", author); //sbr.AppendFormat("<em style=\"margin-left:53px\">{0}</em>", article_addtime); } //else //{ // sbr.AppendFormat("<em style=\"margin-left:0\">{0}</em>", article_addtime); //} sbr.AppendFormat("<span class=\"org\"><i>{0}</i>来源于:<a href=\"http://www.ypindapei.com/\" title=\"衣品搭配\" target=\"_blank\">衣品搭配</a></span>", article_addtime); sbr.AppendFormat("<span>"); //sbr.AppendFormat("<span class=\"comment-sum\"><b>{0}</b> 评论</span>", review_cnt); //sbr.AppendFormat("<span><b></b>分享</span>"); sbr.AppendFormat("<span>"); sbr.AppendFormat("分享:<span class=\"bdsharebuttonbox\" id=\"share\" style=\"float: right;\"><a href=\"#\" class=\"bds_weixin\" data-cmd=\"weixin\" title=\"分享到微信\"></a><a href=\"#\" class=\"bds_tsina\" data-cmd=\"tsina\" title=\"分享到新浪微博\"></a><a href=\"#\" class=\"bds_qzone\" data-cmd=\"qzone\" title=\"分享到QQ空间\"></a></span>"); sbr.AppendFormat("</span>"); sbr.AppendFormat("</span>"); sbr.AppendFormat("</p>"); //sbr.AppendFormat("</div>"); //sbr.AppendFormat("<div class=\"hren-header\">"); //sbr.AppendFormat("<span class=\"cbhren\">唱吧红人</span>"); //sbr.AppendFormat("<span class=\"hrenID\">ID:<em>SHL-123456789</em></span>"); //sbr.AppendFormat("<span class=\"hrenfans\">唱吧粉丝:<em>33万</em></span>"); //sbr.AppendFormat("<span class=\"hrentx\"><img src=\"http://e.hiphotos.baidu.com/baike/w%3D268%3Bg%3D0/sign=52775554b6003af34dbadb660d11a161/d50735fae6cd7b89faf58fde0f2442a7d8330ed5.jpg\"></span>"); //sbr.AppendFormat("<span class=\"hrenfonc\">关注:34</span>"); //sbr.AppendFormat("<span class=\"hrenfc\">粉丝:16334</span>"); //sbr.AppendFormat("<span class=\"hrenName\">魏道道</span>"); //sbr.AppendFormat("<span class=\"hrenloc\">来自:<em>北京</em><em>北京</em><em>朝阳区</em></span>"); //sbr.AppendFormat("<a class=\"hrenfasixin\"><img src=\"/template/img/fasixin.jpg\"></a>"); //sbr.AppendFormat("<a class=\"hrenjiaguanzhu\"><img src=\"template/img/jiaguanzhu.jpg\"></a>"); sbr.AppendFormat("</div>"); sbr.AppendFormat("<div class=\"main-content-body\">"); //sbr.AppendFormat("<p class=\"abstract\">[<strong>摘要</strong>]她尝试了各种事情,也尝试了和王子约会,然后发现,还是做女王大人更有趣。</p>"); if (video_url != "") { if (video_url.Contains("swf")) { sbr.AppendFormat("<p style=\"text-align: center;\"><embed width=\"600\" height=\"390\" allowfullscreen=\"true\" allowscriptaccess=\"never\" menu=\"false\" loop=\"false\" play=\"true\" wmode=\"transparent\" src=\"{0}\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" class=\"edui-faked-video\" type=\"application/x-shockwave-flash\"></p>", video_url); } else { sbr.AppendFormat("<object id=\"CuPlayerVideo_video_object\" width=\"100%\" height=\"400\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"><param name=\"movie\" value=\"/Flash/player.swf?v=2.5\"><param name=\"flashvars\" value=\"JcScpFile=/Flash/CuSunV2set.xml&JcScpVideoPath={0}&JcScpImg=/Flash/start.jpg\"><param name=\"allowFullScreen\" value=\"true\"><param name=\"allowScriptAccess\" value=\"always\"><param name=\"wmode\" value=\"Transparent\"><embed id=\"CuPlayerVideo_video_embed\" src=\"/Flash/player.swf?v=2.5\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" wmode=\"Transparent\" width=\"100%\" height=\"400\" flashvars=\"JcScpFile=/Flash/CuSunV2set.xml&JcScpVideoPath={0}&JcScpImg=/Flash/start.jpg\"></object>", video_url); } } if (article_contents.Contains("欲查看更多精彩内容请扫描下方二维码")) { ishave_rcode = "1"; } sbr.AppendFormat("{0}", article_contents.Replace("<img", "<img alt='衣品搭配'").Replace("undefined", "")); sbr.AppendFormat("</div>"); #endregion } } else { result = "no"; sbr.Append("<div class=\"nodata\">没有找到相关数据</div>"); } } catch (Exception ex) { sbr.Append(ex.ToString()); } if (type == 6) { result = "no"; } context.Put("detail", sbr.ToString()); context.Put("result", result); context.Put("ishave_rcode", ishave_rcode); ////获取评论、回复内容列表 //GetReviewContent(context); context.Put("type", type); //获取指南栏目下最新的10条记录 GetList(context); //获取上衣、裤装、裙装、女鞋、包包、配饰、美妆等栏目下的最新的16条记录 GetList_fuzhuang(context); } }
/// <summary> /// 加载文章列表 /// </summary> /// <param name="context"></param> private void GetList(NVelocity.VelocityContext context) { sbr.Clear(); try { PageClass pc = new PageClass(); int record_cnt = 0; int page_cnt = 0; int curpage = 1; int pagesize = 49; curpage = String_Manage.Return_Request_Int("page", 1); int page = 0; if (curpage > 0) { page = curpage - 1; } string where = " and types=370 and isend=0 and a.pub_state=0 and type_parent=" + type_parent + " and New_Zixun_Is_Tbk=0 "; if (stype > 0) { where = " and charindex('," + stype + ",',','+New_Zixun_Idlist+',')>0 "; } #region 根据季节显示文章列表 string season_where = ""; if (season_require_id_linshi != "" && season_require_id_linshi != ",,") { season_where = " and ("; string[] sarr = season_require_id_linshi.Split(','); for (int s = 0; s < sarr.Length; s++) { string nseasonid = sarr[s]; if (nseasonid != "") { season_where += "or charindex('," + nseasonid + ",',','+New_Zixun_Season+',')>0 "; } } season_where = season_where.Replace("(or", "("); season_where += ")"; } if (season_where.IndexOf("charindex") > 0) { where += season_where; } #endregion //context.Put("redirecturl_error",page+"@@@@@@"+ where); ds = pc.TagList_New("*", " edittime desc ", " hrenh_article a ", where, page, pagesize, " id,title,isimg,img_url,edittime,New_Zixun_Price,New_Zixun_intro_short,isnull((select product_name from HRENH_PRODUCT_PLATINFO where id=a.product_plat_id),'') as platname,isnull((select Produce_Img from HRENH_PRODUCT_PLATINFO where id=a.product_plat_id),'') as platimg,New_Zixun_Idlist "); if (ds != null && ds.Tables[2].Rows.Count > 0) { record_cnt = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); page_cnt = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString()); for (int i = 0; i < ds.Tables[2].Rows.Count; i++) { DataRow dr = ds.Tables[2].Rows[i]; #region 文章列表的信息 int article_id = String_Manage.Return_Int(dr["id"].ToString(), 0); string article_title = String_Manage.Return_Str(dr["title"].ToString(), ""); string short_intro = String_Manage.Return_Str(dr["New_Zixun_intro_short"].ToString(), ""); //if (type != 406 && type != 407 && type != 431) //{ // if (short_intro != "") // { // article_title = short_intro; // } //} string show_article_title = StringHelper.ReturnNumStr(article_title, 0, 29); int isimg = String_Manage.Return_Int(dr["isimg"].ToString(), 0); string article_img = "/template/img/nocontent.png"; if (isimg == 1) { article_img = ImgHelper.Get_UploadImgUrl(dr["img_url"].ToString(), 1); } string article_addtime = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 1); string prices = String_Manage.Return_Str(dr["New_Zixun_Price"].ToString(), "0"); prices = Recruit_Job.Return_Money(prices, 1); //韩系、日系、欧美三个栏目下被推荐的文章 prname = "dapei"; type_shouzimu = ""; string article_url = " href='/" + prname + type_shouzimu + "/show_" + article_id + ".html' target='_blank' title='" + article_title + "' "; string platname = String_Manage.Return_Str(dr["platname"].ToString(), ""); string platimg = String_Manage.Return_Str(dr["platimg"].ToString(), ""); if (platimg != "") { platimg = ImgHelper.Get_UploadImgUrl(platimg, 1); } #region 获取当前文章类型下的(特点人群下的第一类和气质风格下的第一类) string typeidlist = dr["New_Zixun_Idlist"].ToString(); typeidlist = Set_Season_Ypdp_Typename.Get_Typename_list(typeidlist); #endregion #endregion #region 加载文章列表 sbr.AppendFormat("<dl class=\"shopone\">"); //sbr.AppendFormat("<a {0}>", article_url); //sbr.AppendFormat("<dt><img src=\"{0}\" alt=\"{1}\"><p>{2}</p></dt>", article_img,article_title, typeidlist); ////sbr.AppendFormat("<dt><img src=\"{0}\" alt=\"{1}\"><img class=\"tb\" src=\"{2}\" alt=\"{3}\"></dt>", article_img, article_title, platimg, platname + "有售"); //sbr.AppendFormat("<dd>"); //sbr.AppendFormat("<h4>{0}</h4>", show_article_title); ////if (platname != "") ////{ //// sbr.AppendFormat("<b title=\"{1}购买直通车\"><i class=\"sppt\"><img src=\"{2}\" alt=\"{1}\"></i><i>¥</i>{0}</b>", prices, platname, platimg); ////} ////else ////{ //// sbr.AppendFormat("<b><i>¥</i>{0}</b>",prices); ////} //////sbr.AppendFormat("<div class=\"fav\"><em class=\"fav-i\"></em> <span class=\"fav-n\">1228</span> </div>"); //sbr.AppendFormat("</dd>"); //sbr.AppendFormat("</a>"); sbr.AppendFormat("<dt>"); sbr.AppendFormat("<a {0}>", article_url); sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\">", article_img, article_title); sbr.AppendFormat("</a>"); sbr.AppendFormat("<p><a {0}>{1}</a></p>", article_url, typeidlist); sbr.AppendFormat("</dt>"); sbr.AppendFormat("<dd>"); sbr.AppendFormat("<a {0}>", article_url); sbr.AppendFormat("<h4>{0}</h4>", show_article_title); sbr.AppendFormat("</a>"); sbr.AppendFormat("</dd>"); sbr.AppendFormat("</dl>"); #endregion } } else { sbr.Append("<div class=\"nodata\"></div>"); } if (curpage > page_cnt) { curpage = page_cnt; } if (curpage < page_cnt) { sbr.AppendFormat("<dl class=\"shopone\">"); sbr.AppendFormat("<a href=\"javascript:;\" title=\"下一页\" class=\"cat-page-next trans200\" onclick='GoPage(" + (curpage + 1) + ")'></a>"); sbr.AppendFormat("</dl>"); } context.Put("list", sbr.ToString()); context.Put("listPage", NewXzc.Common.GenerPage.pageHtml(record_cnt, pagesize, curpage, "GoPage")); } catch (Exception ex) { context.Put("redirecturl", "/404"); } }
/// <summary> /// 获取议会活动列表 /// </summary> /// <param name="context"></param> private void GetList(NVelocity.VelocityContext context) { StringBuilder sbr = new StringBuilder(); int pagesize = 2; int type = 1; string where = " (types=" + type + " or types_pid=" + type + ") and isend=0 and a.pub_state=0 "; DataSet ds = DbHelperSQL.Query("select top " + pagesize + " id,title,isimg,img_url,contents,(isnull(read_cnt,0)+FALSH_READ_CNT) as read_cnt,edittime from hrenh_article a where" + where); if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr = ds.Tables[0].Rows[i]; #region 文章列表的信息 int article_id = String_Manage.Return_Int(dr["id"].ToString(), 0); string article_title = String_Manage.Return_Str(dr["title"].ToString(), ""); string show_article_title = StringHelper.ReturnNumStr(article_title, 0, 36); int isimg = String_Manage.Return_Int(dr["isimg"].ToString(), 0); string article_img = "/template/img/nocontent.png"; if (isimg == 1) { article_img = ImgHelper.Get_UploadImgUrl(dr["img_url"].ToString(), 1); } string article_contents = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 76); string article_contents_noimg = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 170); string article_addtime = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 1); int read_cnt = String_Manage.Return_Int(dr["read_cnt"].ToString(), 0); string article_url = "href=\"/article_detail_" + article_id + "\" target=\"_blank\" title=\"" + article_title + "\""; article_url = "href=\"/zixun/detail_" + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\""; #endregion #region 加载文章列表 sbr.AppendFormat("<dl class=\"mar0 listone\">"); sbr.AppendFormat("<dt style=\"float:left;\">"); sbr.AppendFormat("<a {0}>", article_url); sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" width=\"300\" height=\"200\">", article_img, article_title); sbr.AppendFormat("</a>"); sbr.AppendFormat("</dt>"); sbr.AppendFormat("<dd style=\"float: left;padding-left:19px; \">"); sbr.AppendFormat("<h3>"); sbr.AppendFormat("<a {0} style=\" color: #333;font-size: 20px;font-weight: 900; \">{1}</a>", article_url, show_article_title); sbr.AppendFormat("</h3>"); sbr.AppendFormat("<h3 class=\"hh2\">"); sbr.AppendFormat("<p class=\"content\"\">"); sbr.AppendFormat("<a {0}>{1}", article_url, article_contents); sbr.AppendFormat("</a>"); sbr.AppendFormat("</p>"); sbr.AppendFormat("<p class=\"main-share\">"); sbr.AppendFormat("<span class=\"clearfix\" style=\"margin-top:4px;\">"); sbr.AppendFormat("<span class=\"list-time\">发布时间:{0}</span>", article_addtime); sbr.AppendFormat("<span class=\"list-view-data\">"); sbr.AppendFormat("</span>"); sbr.AppendFormat("</span>"); sbr.AppendFormat("</p>"); sbr.AppendFormat("</h3>"); sbr.AppendFormat("</dd>"); sbr.AppendFormat("</dl>"); #endregion } } else { sbr.Append("<div class=\"nodata\">没有找到相关数据</div>"); } context.Put("list", sbr.ToString()); }