public string showNewGoods() { StringBuilder stringBuilder = new StringBuilder(); JpGoods jpGoods = new JpGoods(); DataTable dt = jpGoods.getNewsGood(10); string strTitle = ""; 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("<a onclick=\"locationDetail('" + dt.Rows[i]["hy_linkurl"].ToString() + "','" + locationType + "','0')\" > <li>"); HyFileatt hyFileatt = new HyFileatt(); DataTable dt_img = hyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString()); if (dt_img.Rows.Count > 0) { stringBuilder.Append("<img src=\"" + dt_img.Rows[0]["hy_filepath"].ToString() + "\">"); } stringBuilder.Append("<p>" + strTitle + "</p>"); stringBuilder.Append("<span>¥" + Convert.ToDecimal(dt.Rows[i]["hy_goodsprice"].ToString()).ToString("0.00") + "</span><i class=\"btn-dg\">订购</i></li></a>"); } return stringBuilder.ToString(); }
public string getExport() { StringBuilder stringBuilder = new StringBuilder(); dt_expert dtExpert = new dt_expert(); DataSet dt = dtExpert.GetListTop(10, ""); DataTable dtImg = new DataTable(); HyFileatt hyFileatt = new HyFileatt(); if (dt.Tables[0].Rows.Count > 0) { for (int i = 0; i < dt.Tables[0].Rows.Count; i++) { dtImg = hyFileatt.Getdocsfm(dt.Tables[0].Rows[i]["ID"].ToString()); stringBuilder.Append("<li><a target=\"_blank\" href=\"showExportMain.aspx?docid=" + dt.Tables[0].Rows[i]["ID"].ToString() + "&rend=" + System.Guid.NewGuid().ToString() + "\">"); if (dtImg.Rows.Count > 0) { stringBuilder.Append("<img src=\"" + dtImg.Rows[0]["hy_filepath"].ToString() + "\">"); } else { stringBuilder.Append("<img src=\"Images/Img.jpg\">"); } dtImg.Clear(); stringBuilder.Append("</a></li>"); } } return stringBuilder.ToString(); }
protected void Page_Load(object sender, EventArgs e) { StringBuilder stringBuilder = new StringBuilder(); HySearchArt hySearchArt = new HySearchArt(); DataTable dt = hySearchArt.getData("", 10); string strArtType = "0"; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["hy_url"].ToString() == "art_detail.aspx") { strArtType = "1"; } else if (dt.Rows[i]["hy_url"].ToString() == "photo_detail.aspx") { strArtType = "2"; } if (dt.Rows[i]["type"].ToString() == "1") { stringBuilder.Append("<div><a onclick=\"locationDetail('" + dt.Rows[i]["hy_url"].ToString() + "','" + locationType + "','" + strArtType + "','0')\" ><img src=\"" + dt.Rows[i]["img"].ToString() + "\">" + dt.Rows[i]["hy_title"].ToString() + "</a></div>"); } else if (dt.Rows[i]["type"].ToString() == "0") { HyFileatt hyFileatt = new HyFileatt(); DataTable dt_img = hyFileatt.Getdocsfm(dt.Rows[i]["img"].ToString()); if (dt_img.Rows.Count > 0) { stringBuilder.Append("<div><a onclick=\"locationDetail('" + dt.Rows[i]["hy_url"].ToString() + "','" + locationType + "','" + strArtType + "','0')\" ><img src=\"" + dt_img.Rows[0]["hy_filepath"].ToString() + "\">" + dt.Rows[i]["hy_title"].ToString() + "</a></div>"); } } } } strShowData = stringBuilder.ToString(); }
protected void Page_Load(object sender, EventArgs e) { StringBuilder stringBuilder = new StringBuilder(); dt_expert dtExpert = new dt_expert(); DataSet dt = dtExpert.GetList(""); DataTable dtImg = new DataTable(); HyFileatt hyFileatt = new HyFileatt(); //控制数据条数 int s = 0; if (dt.Tables[0].Rows.Count > 0) { //分行 int n = 0; if ((dt.Tables[0].Rows.Count) % 4 == 0) { n = (dt.Tables[0].Rows.Count) / (4); } else { n = ((dt.Tables[0].Rows.Count) / (4)) + 1; } //构造列 for (int i = 0; i < n; ++i) { stringBuilder.Append("<ul>"); //控制循环条件 int m = 0; if ((dt.Tables[0].Rows.Count - (i * 4)) > 4) { m = 4; } else { m = dt.Tables[0].Rows.Count - (i * 4); } for (int j = 0; j < m; j++) { dtImg = hyFileatt.Getdocsfm(dt.Tables[0].Rows[s]["ID"].ToString()); stringBuilder.Append("<li><a href=\"showExportMain.aspx?docid=" + dt.Tables[0].Rows[s]["ID"].ToString() + "&rend=" + System.Guid.NewGuid().ToString() + "\">"); if (dtImg.Rows.Count > 0) { stringBuilder.Append("<img src=\"" + dtImg.Rows[0]["hy_filepath"].ToString() + "\">"); } else { stringBuilder.Append("<img src=\"Images/Img.jpg\">"); } dtImg.Clear(); stringBuilder.Append("<dt align=\"center\" >" + dt.Tables[0].Rows[s]["dt_name"].ToString() + "</dt></a></li>"); s++; } stringBuilder.Append("</ul>"); } } this.lb_show.Text = stringBuilder.ToString(); }
protected void Page_Load(object sender, EventArgs e) { string ls_page = "1", ls_pagesize = "10"; TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); //获取参数 if (this.Request.QueryString["page"] != null) { ls_page = this.Request.QueryString["page"].ToString(); } if (this.Request.QueryString["pagesize"] != null) { ls_pagesize = this.Request.QueryString["pagesize"].ToString(); } string ls_where = " and hy_ifsh ='2' "; string ls_orderby = " order by hy_addtime desc "; JpPhotography jpPhotography = new JpPhotography(); //获取数据 string test = ""; DataTable dt = jpPhotography.SearchdocsByKey(ls_where,ls_orderby, int.Parse(ls_page), int.Parse(ls_pagesize)); Response.Write(test); //复制一个DataTalbe DataTable tempTable = dt.Clone(); //在现有的DatatTable增加一列 DataColumn col = new DataColumn("showTime", typeof(String)); //将列添加到DataTable中去 tempTable.Columns.Add(col); //在现有的DatatTable增加一列 DataColumn co2 = new DataColumn("showImg", typeof(String)); //将列添加到DataTable中去 tempTable.Columns.Add(co2); //循环 对DataTable重新赋值 for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[tempTable.Columns[j].ColumnName] = dt.Rows[i][j]; } //获得间隔的时间 dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["hy_addtime"].ToString())); HyFileatt hyFileatt = new HyFileatt(); DataTable dt_img = hyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString()); if (dt_img.Rows.Count > 0) { dr["showImg"] = dt_img.Rows[0]["hy_filepath"].ToString(); } tempTable.Rows.Add(dr); } //转换成json格式 string strJson = JsonConvert.SerializeObject(tempTable); //数据抛出 Response.Write(strJson); }
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(); }
//设置封面 protected void btnSzfm_Click(object sender, EventArgs e) { TPortalClass.HyFileatt HyFileatt = new TPortalClass.HyFileatt(); DataTable dt = HyFileatt.Getdocsfm(this.txtdocid.Value); if (dt.Rows.Count > 0) { HyFileatt.id = dt.Rows[0]["id"].ToString(); HyFileatt.hy_fm = 0; HyFileatt.UpdateFM(); } HyFileatt.id = this.txtfmid.Value; HyFileatt.hy_fm = 1; HyFileatt.UpdateFM(); //操作日志 // TPortalClass.HyCommon HyCommon = new TPortalClass.HyCommon(); // HyCommon.WriteLog("设置封面", "设置封面图片ID:" + this.txtdocid.Value, this.Session["hy_id"].ToString(), this.Session["hy_name"].ToString()); Response.Write("<script>location.replace(location);</script>"); }
public void showData(string strOrder) { string ls_where = " and hy_ifsh ='2' "; string ls_orderby = " "; if (strOrder == "1") { ls_orderby += " order by praiseCount desc "; } else { ls_orderby += " order by hy_addtime desc "; } JpPhotography JpPhotography = new JpPhotography(); int colcous = 1; //获取数据 StringBuilder stringBuilder = new StringBuilder(); DataTable dt = JpPhotography.SearchdocsByKey(ls_where, ls_orderby, 1, 10); string strTitle = ""; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { strTitle = dt.Rows[i]["hy_content"].ToString(); if (strTitle.Length > 10) { strTitle = strTitle.Substring(0, 10) + "..."; } stringBuilder.Append("<li><a onclick=\"locationDetail('photo_detail.aspx?aid=" + dt.Rows[i]["id"].ToString() + "&rend=" + System.Guid.NewGuid().ToString() + "','" + locationType + "','2')\"><div class='pplist'><p class=\"ico-tx\"><img src=\"images/321tx.png\" style='width: 30px;height: 30px; display:block; float:left;'><span>" + dt.Rows[i]["hy_uid"].ToString() + "</span></p><p>" + strTitle + "</p>"); HyFileatt hyFileatt = new HyFileatt(); DataTable dt_img = hyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString()); if (dt_img.Rows.Count > 0) { stringBuilder.Append("<img src=\"" + dt_img.Rows[0]["hy_filepath"].ToString() + "\">"); } stringBuilder.Append("</div>点攒数:" + dt.Rows[i]["praiseCount"].ToString() + "</a></li>"); } } this.lb_show.Text = stringBuilder.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (this.Request.QueryString["docid"] != null) { strDocid = this.Request.QueryString["docid"].ToString(); } StringBuilder stringBuilder = new StringBuilder(); dt_expert dtExpert = new dt_expert(); dtExpert.ID = strDocid; DataSet dt = dtExpert.GetListById(); DataTable dtImg = new DataTable(); HyFileatt hyFileatt = new HyFileatt(); dtImg = hyFileatt.Getdocsfm(strDocid); stringBuilder.Append("<div class=\"exp_Bottom\">"); if (dt.Tables[0].Rows.Count > 0 && dtImg.Rows.Count > 0) { stringBuilder.Append("<img src=\"" + dtImg.Rows[0]["hy_filepath"].ToString() + "\">"); stringBuilder.Append("<span>" + dt.Tables[0].Rows[0]["dt_name"].ToString() + "</span><p>"); stringBuilder.Append(dt.Tables[0].Rows[0]["dt_summary"].ToString()); } stringBuilder.Append("</p></div>"); this.lb_show.Text = stringBuilder.ToString(); }
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(); }
public string showScroll() { StringBuilder stringBuilder = new StringBuilder(); JpGoods jpGoods = new JpGoods(); DataTable dt = jpGoods.getNewsGood(5); string strTitle = ""; 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>"); stringBuilder.Append("<div class=\"slide\">"); 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 + "','0')\" ><img src=\"" + dt_img.Rows[0]["hy_filepath"].ToString() + "\" alt=\"" + strTitle + "\" >"); } stringBuilder.Append("<div class=\"caption\">"); stringBuilder.Append("<p class=\"title\">" + strTitle + "</p>"); stringBuilder.Append("</div></a>"); stringBuilder.Append("</div>"); stringBuilder.Append("</li>"); } return stringBuilder.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (this.Request.QueryString["page"] != null) { try { pageNo = Convert.ToInt32(this.Request.QueryString["page"].ToString()); } catch { pageNo = 1; } } StringBuilder stringBuilder = new StringBuilder(); dt_expert dtExpert = new dt_expert(); DataSet dt = dtExpert.GetListPage(pageNo, pageSize, ""); DataSet dtDataSet = dtExpert.GetList(""); totalPage = dtDataSet.Tables[0].Rows.Count / pageSize; if (dtDataSet.Tables[0].Rows.Count % pageSize > 0) { totalPage++; } this.lb_page.Text = HyCommon.page("\"#Pagle\"", pageNo.ToString(), pageSize.ToString(), totalPage.ToString(), ""); DataTable dtImg = new DataTable(); HyFileatt hyFileatt = new HyFileatt(); //控制数据条数 int s = 0; if (dt.Tables[0].Rows.Count > 0) { //分行 int n = 0; if ((dt.Tables[0].Rows.Count) % 4 == 0) { n = (dt.Tables[0].Rows.Count) / (4); } else { n = ((dt.Tables[0].Rows.Count) / (4)) + 1; } //构造列 for (int i = 0; i < n; ++i) { stringBuilder.Append("<ul>"); //控制循环条件 int m = 0; if ((dt.Tables[0].Rows.Count - (i * 4)) > 4) { m = 4; } else { m = dt.Tables[0].Rows.Count - (i * 4); } for (int j = 0; j < m; j++) { dtImg = hyFileatt.Getdocsfm(dt.Tables[0].Rows[s]["ID"].ToString()); stringBuilder.Append("<li><a href=\"showExportMain.aspx?docid=" + dt.Tables[0].Rows[s]["ID"].ToString() + "&rend=" + System.Guid.NewGuid().ToString() + "\">"); if (dtImg.Rows.Count > 0) { stringBuilder.Append("<img src=\"" + dtImg.Rows[0]["hy_filepath"].ToString() + "\">"); } else { stringBuilder.Append("<img src=\"Images/Img.jpg\">"); } dtImg.Clear(); stringBuilder.Append("<dt align=\"center\" >" + dt.Tables[0].Rows[s]["dt_name"].ToString() + "</dt></a></li>"); s++; } stringBuilder.Append("</ul>"); } } this.lb_show.Text = stringBuilder.ToString(); }
protected void Page_Load(object sender, EventArgs e) { string strCid = ""; int ls_page = 1, ls_pagesize = 10; string strType = ""; TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); //获取参数 if (this.Request.QueryString["cid"] != null) { strCid = this.Request.QueryString["cid"].ToString(); } if (this.Request.QueryString["page"] != null) { ls_page = Convert.ToInt32(this.Request.QueryString["page"].ToString()); } if (this.Request.QueryString["pagesize"] != null) { ls_pagesize = Convert.ToInt32(this.Request.QueryString["pagesize"].ToString()); } if (this.Request.QueryString["type"] != null) { strType = this.Request.QueryString["type"].ToString(); } JpGoods jpGoods = new JpGoods(); string strWhere = " and hy_cid like '" + strCid + "%' and hy_ifsh='2' "; if (strType == "0") { strWhere = " and hy_cid like '" + strCid + "%' and hy_ifsh='2' "; } else if (strType == "1") { strWhere = " and (hy_cid = '006001001' or hy_cid='006002001' or hy_cid='006003001' or hy_cid='006004001') and hy_ifsh='2' "; } else if (strType == "2") { strWhere = " and (hy_cid = '006001002' or hy_cid='006002002' or hy_cid='006003002' or hy_cid='006004002') and hy_ifsh='2' "; } else if (strType == "3") { strWhere = " and (hy_cid = '006001003' or hy_cid='006002003' or hy_cid='006003003' or hy_cid='006004003') and hy_ifsh='2' "; } string orderby = " order by hy_addtime desc "; //获取数据 DataTable dt = jpGoods.SearchdocsByKey(strWhere, orderby, ls_page, ls_pagesize); //复制一个DataTalbe DataTable tempTable = dt.Clone(); //在现有的DatatTable增加一列 DataColumn col = new DataColumn("showImg", typeof(String)); //将列添加到DataTable中去 tempTable.Columns.Add(col); DataColumn col2 = new DataColumn("showTime", typeof(String)); //将列添加到DataTable中去 tempTable.Columns.Add(col2); //循环 对DataTable重新赋值 for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[tempTable.Columns[j].ColumnName] = dt.Rows[i][j]; } //获得间隔的时间 HyFileatt hyFileatt = new HyFileatt(); DataTable dt_img = hyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString()); if (dt_img.Rows.Count > 0) { dr["showImg"] = dt_img.Rows[0]["hy_filepath"].ToString(); } dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["hy_addtime"].ToString())); tempTable.Rows.Add(dr); } //转换成json格式 string strJson = JsonConvert.SerializeObject(tempTable); //数据抛出 Response.Write(strJson); }
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(); }