Beispiel #1
0
 public string RptBind()
 {
     //获取数据
     StringBuilder stringBuilder = new StringBuilder();
     JpGoods jpGoods = new JpGoods();
     string strWhere = "";
     if (strType == "0")
     {
         strWhere = " and hy_cid like '" + cid + "%' and hy_ifsh='2' ";
     }
     else if (strType == "1")
     {
         strWhere = " and hy_cid like '" + cid + "%' and hy_ifsh='2' ";
     }
     else if (strType == "2")
     {
         strWhere = " and hy_cid like '" + cid + "%' and hy_ifsh='2' ";
     }
     else if (strType == "3")
     {
         strWhere = " and hy_cid like '" + cid + "%' and hy_ifsh='2' ";
     }
     DataTable dt = jpGoods.getDataByCid(10, strWhere);
     string strTitle = "";
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             strTitle = dt.Rows[i]["hy_goodsname"].ToString();
             if (strTitle.Length > 18)
             {
                 strTitle = strTitle.Substring(0, 18) + "...";
             }
             stringBuilder.Append("<li>");
             HyFileatt hyFileatt = new HyFileatt();
             DataTable dt_img = hyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString());
             if (dt_img.Rows.Count > 0)
             {
                 stringBuilder.Append("<a onclick=\"locationDetail('" + dt.Rows[i]["hy_linkurl"].ToString() + "','" + locationType + "')\"><img src=\"" + dt_img.Rows[0]["hy_filepath"].ToString() + "\">");
             }
             stringBuilder.Append("<h1>");
             stringBuilder.Append("" + strTitle + "</h1><p class=\"fleft\">" + JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["hy_addtime"].ToString())) + "</p></a></li>");
         }
     }
     return stringBuilder.ToString();
 }