Ejemplo n.º 1
0
 public string showActive()
 {
     StringBuilder stringBuilder = new StringBuilder();
     JpActivity jpActivity = new JpActivity();
     DataTable dt = jpActivity.getActive(5);
     HyFileatt HyFileatt = new HyFileatt();
     string strTitle = "";
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             strTitle = dt.Rows[i]["hy_bt"].ToString();
             if (strTitle.Length > 20)
             {
                 strTitle = strTitle.Substring(0, 20) + "...";
             }
             stringBuilder.Append("<div class=\"wszw\">" + Convert.ToDateTime(dt.Rows[i]["hy_addtime"].ToString()).ToString("mm:ss") + "</div>");
             stringBuilder.Append("<div class=\"jptx\"><a  onclick=\"locationDetail('active_detail.aspx?id=" + dt.Rows[i]["id"].ToString() + "&rend=" + System.Guid.NewGuid().ToString() + "','" + locationType + "','0')\" href=\"javascript:void(0);\" >");
             stringBuilder.Append("<div class=\"jptxpp\">");
             DataTable dt_img = HyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString());
             if (dt_img.Rows.Count > 0)
             {
                 stringBuilder.Append("<span><img src=\"" + dt_img.Rows[0]["hy_filepath"].ToString() + "\" alt=\"" + strTitle + "\" /></span>");
             }
             else
             {
                 stringBuilder.Append("<span><img src=\"nophoto.jpg\" alt=\"" + strTitle + "\" /></span>");
             }
             //nophoto
             stringBuilder.Append("<div class=\"jptxsub\"><span>" + strTitle + "</span></a><i class=\"ico-bm\" onclick=\"hdbm('" + dt.Rows[i]["id"].ToString() + "')\" >报名</i></div>");
             stringBuilder.Append("</div></a>");
             stringBuilder.Append("</div>");
         }
     }
     return stringBuilder.ToString();
 }
Ejemplo n.º 2
0
 public string showRollingActive()
 {
     StringBuilder stringBuilder = new StringBuilder();
     JpActivity jpActivity = new JpActivity();
     DataTable dt = jpActivity.getActive(5);
     HyFileatt HyFileatt = new HyFileatt();
     string strTitle = "";
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             strTitle = dt.Rows[i]["hy_bt"].ToString();
             if (strTitle.Length > 20)
             {
                 strTitle = strTitle.Substring(0, 20) + "...";
             }
             stringBuilder.Append("<li>");
             stringBuilder.Append("<div class=\"slide\">");
             DataTable dt_img = HyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString());
             if (dt_img.Rows.Count > 0)
             {
                 stringBuilder.Append("<span><a onclick=\"locationDetail('active_detail.aspx?id=" + dt.Rows[i]["id"].ToString() + "&rend=" + System.Guid.NewGuid().ToString() + "','" + locationType + "','0')\" href=\"javascript:void(0);\" ><img src=\"" + dt_img.Rows[0]["hy_filepath"].ToString() + "\" alt=\"" + strTitle + "\"/></span>");
             }
             stringBuilder.Append("<div class=\"caption\">");
             stringBuilder.Append("<p class=\"title\" >" + strTitle + "</a></p>");
             stringBuilder.Append("</div>");
             stringBuilder.Append("</div>");
             stringBuilder.Append("</li>");
         }
     }
     return stringBuilder.ToString();
 }