/// <summary> /// 获取企业用户的总金额、余额,0:总金额,1:已花费金额,2:余额,3:可开具发票的金额 /// </summary> /// <param name="userid">企业用户ID</param> /// <param name="types">0:总金额,1:已花费金额,2:余额</param> /// <returns></returns> public static int Get_Company_Money(int userid, int types) { int money = 0; string sql = ""; if (types == 0) { sql = "select isnull(sum(money),0) as total_money from invite_company_recharge where userid=@userid and state=1"; } else if (types == 1) { //sql = "select isnull(sum(moneys),0) as look_money from Invite_Look_Resume_LinkStyle where userid=@userid and seltype=0"; sql = "select isnull(sum(moneys),0) as look_money from Invite_Look_Resume_LinkStyle where userid=@userid"; } else if (types == 2) { //sql = "select ((select isnull(sum(money),0) as total_money from invite_company_recharge where userid=@userid and state=1)-(select isnull(sum(moneys),0) as look_money from Invite_Look_Resume_LinkStyle where userid=@userid and seltype=0)) as balance_money "; sql = "select ((select isnull(sum(money),0) as total_money from invite_company_recharge where userid=@userid and state=1)-(select isnull(sum(moneys),0) as look_money from Invite_Look_Resume_LinkStyle where userid=@userid)) as balance_money "; } else if (types == 3) { //sql = "select ((select isnull(sum(moneys),0) as look_money from Invite_Look_Resume_LinkStyle where userid=@userid and seltype=0)-(select isnull(sum(moneys),0) from Invite_Invoice where userid=@userid)) as balance_money"; sql = "select ((select isnull(sum(moneys),0) as look_money from Invite_Look_Resume_LinkStyle where userid=@userid)-(select isnull(sum(moneys),0) from Invite_Invoice where userid=@userid)) as balance_money"; } SqlParameter[] para = { new SqlParameter("@userid", SqlDbType.Int) }; para[0].Value = userid; object obj = DbHelperSQL.GetSingle(sql, para); if (obj != null) { money = Convert.ToInt32(Recruit_Job.Return_Money(obj.ToString(), 2)); } return(money); }
/// <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 Get_Top20_Zixun(NVelocity.VelocityContext context) { sbr.Clear(); StringBuilder listsbr = new StringBuilder(); int pagesize = 20; string where = " isend=0 and pub_state=0 and ishot=1 "; 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 } string sql = "select top " + pagesize + " id,title,New_Zixun_intro_short,isimg,img_url,New_Zixun_Price,types,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 from Hrenh_Article a where " + where + "order by istop desc,edittime desc"; ds = DbHelperSQL.Query(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { sbr.AppendFormat("<h4 class=\"lineread\">更多穿搭推荐</h4>"); sbr.AppendFormat("<div class=\"shop\" style=\"margin-left:-20px;\">"); 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, 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); } int atype = Convert.ToInt32(dr["types"].ToString()); if (atype != 370) { article_title = String_Manage.Return_Str(dr["New_Zixun_intro_short"].ToString(), ""); } //string atypename = type_bll.GetModel(type).TypeName; string typeurl = ""; //if (type == 370) //{ // typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + "/"; //} //else //{ // //通过汉字获取该汉字的首字母 // string type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(typename); // typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + type_shouzimu + "/"; //} if (atype == 370) { typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + "/"; } else { typename = type_bll.GetModel(atype).TypeName; //通过汉字获取该汉字的首字母 string type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(typename); typeurl = "/" + ArticleHelper.Get_Type_Rname(atype) + type_shouzimu + "/"; } string navurl = typeurl + "show_"; string article_url = "href=\"" + navurl + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\""; string New_Zixun_Price = dr["New_Zixun_Price"].ToString(); New_Zixun_Price = Recruit_Job.Return_Money(New_Zixun_Price, 1); 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 } sbr.AppendFormat("</div>"); } context.Put("gdcdtj", sbr.ToString()); }
/// <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 Get_Top20_Zixun(NVelocity.VelocityContext context) { sbr.Clear(); StringBuilder listsbr = new StringBuilder(); int pagesize = 20; string where = " isend=0 and pub_state=0 and ishot=1 "; string sql = "select top " + pagesize + " id,title,New_Zixun_intro_short,isimg,img_url,New_Zixun_Price,types,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 " + where + "order by istop desc,edittime desc"; ds = DbHelperSQL.Query(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { sbr.AppendFormat("<h4 class=\"lineread\">更多穿搭推荐</h4>"); sbr.AppendFormat("<div class=\"shop\" style=\"margin-left:-20px;\">"); 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, 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); } int atype = Convert.ToInt32(dr["types"].ToString()); if (atype != 370) { article_title = String_Manage.Return_Str(dr["New_Zixun_intro_short"].ToString(), ""); } //string atypename = type_bll.GetModel(type).TypeName; string typeurl = ""; //if (type == 370) //{ // typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + "/"; //} //else //{ // //通过汉字获取该汉字的首字母 // string type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(typename); // typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + type_shouzimu + "/"; //} if (atype == 370) { typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + "/"; } else { typename = type_bll.GetModel(atype).TypeName; //通过汉字获取该汉字的首字母 string type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(typename); typeurl = "/" + ArticleHelper.Get_Type_Rname(atype) + type_shouzimu + "/"; } string navurl = typeurl + "show_"; string article_url = "href=\"" + navurl + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\""; string New_Zixun_Price = dr["New_Zixun_Price"].ToString(); New_Zixun_Price = Recruit_Job.Return_Money(New_Zixun_Price, 1); 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>"); sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\">", article_img, article_title); sbr.AppendFormat("</dt>"); 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>", New_Zixun_Price, platname, platimg); //} //else //{ // sbr.AppendFormat("<b><i>¥</i>{0}</b>", New_Zixun_Price); //} sbr.AppendFormat("</dd>"); sbr.AppendFormat("</a>"); sbr.AppendFormat("</dl>"); #endregion } sbr.AppendFormat("</div>"); } context.Put("gdcdtj", sbr.ToString()); }
/// <summary> /// 获取相关搭配推荐 /// </summary> /// <param name="context"></param> private void Get_Top10_Zixun(NVelocity.VelocityContext context) { sbr.Clear(); //被要求显示的季节ID string season_require_id = ""; try { season_require_id = DbHelperSQL.GetSingle("select top 1 season_id from HRENH_SET_ARTICLE_SHOW_SEASON order by id desc").ToString(); } catch (Exception ex) { } StringBuilder listsbr = new StringBuilder(); int pagesize = 10; string where = " types=" + type + " and isend=0 and pub_state=0 "; if (season_require_id != "") { where += " and New_Zixun_Season in(" + season_require_id + ")"; } where += " and id<>" + articleid; string sql = "select top " + pagesize + " id,title,types,New_Zixun_intro_short,isimg,img_url,New_Zixun_Price,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 " + where + "order by istop desc,edittime desc"; ds = DbHelperSQL.Query(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { sbr.AppendFormat("<h4 class=\"lineread\">相关搭配推荐</h4>"); sbr.AppendFormat("<div class=\"shop\" style=\"margin-left:-20px;\">"); 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, 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); } int atype = Convert.ToInt32(dr["types"].ToString()); if (atype != 370) { article_title = String_Manage.Return_Str(dr["New_Zixun_intro_short"].ToString(), ""); } string article_url = "href=\"" + navurl + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\""; string New_Zixun_Price = dr["New_Zixun_Price"].ToString(); New_Zixun_Price = Recruit_Job.Return_Money(New_Zixun_Price, 1); 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>"); sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\">", article_img, article_title); sbr.AppendFormat("</dt>"); 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>", New_Zixun_Price, platname, platimg); //} //else //{ // sbr.AppendFormat("<b><i>¥</i>{0}</b>", New_Zixun_Price); //} sbr.AppendFormat("</dd>"); sbr.AppendFormat("</a>"); sbr.AppendFormat("</dl>"); #endregion } sbr.AppendFormat("</div>"); } context.Put("xgdptj", sbr.ToString()); }
/// <summary> /// 相关搜索上方广告 /// </summary> /// <param name="context"></param> private void Init_Search_Ad(NVelocity.VelocityContext context) { StringBuilder sbr = new StringBuilder(); DataSet ds = null; int pid = 1300; sbr.Clear(); ds = recommend_bll.GetList_NewIndex(0, " pageid=" + pid + " and cid=1009 "); 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 title = StringHelper.ReturnNumStr(dr["v1"].ToString(), 0, 0); string show_title = StringHelper.ReturnNumStr(title, 1, 10); string desc = StringHelper.ReturnNumStr(dr["v2"].ToString(), 0, 80); string imgurl = ImgHelper.GetCofigShowUrl() + dr["v3"].ToString(); string httpurl = String_Manage.Return_Str(dr["url"].ToString(), ""); //链接打开方式,1:在本页面打,2:在新页面打开 int openstyle = String_Manage.Return_Int(dr["v4"].ToString(), 0); string width_height = "height=\"90\" width=\"640\""; //if (openstyle != 1 && openstyle != 2) //{ // sbr.AppendFormat("<a href=\"javascript:void(0)\" title=\"{0}\">", title); // sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, title, width_height); // sbr.AppendFormat("</a>"); //} //else //{ // sbr.AppendFormat("<a {1} title=\"{0}\">", title, Return_HttpURL.Return_Url(httpurl, openstyle)); // sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, title, width_height); // sbr.AppendFormat("</a>"); //} string hittpurl = " href=\"javascript:;\" "; show_title = StringHelper.ReturnNumStr(title, 1, 0); width_height = "height=\"128\" width=\"128\""; //<div class="nn" style="position: relative;"><a href="javascript:;"><img src="$img/01.jpg"><p class="tuceng4"><span class="mone">¥54.00</span></p></a></div> sbr.AppendFormat("<div class=\"nn\" style=\"position: relative;\">"); if (openstyle != 1 && openstyle != 2) { sbr.AppendFormat("<a {0} title=\"{1}\">", hittpurl, title); } else { sbr.AppendFormat("<a {0} title=\"{1}\">", Return_HttpURL.Return_Url(httpurl, openstyle), title); } sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, show_title, width_height); sbr.AppendFormat("<p class=\"tuceng4\"><span class=\"mone\">¥{0}</span></p>", Recruit_Job.Return_Money(desc, 2)); sbr.AppendFormat("</a>"); sbr.AppendFormat("</div>"); } } context.Put("Search_Ad", sbr.ToString()); }
/// <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"); } }