protected void Page_Load(object sender, EventArgs e) { cid = Request.QueryString["cid"].ToString(); JpColumns jpColumns = new JpColumns(); DataTable dt = jpColumns.GetColumnBycid(cid); if (dt.Rows.Count > 0) { this.lb_title.Text = dt.Rows[0]["cname"].ToString(); } else { this.lb_title.Text = "审核列表"; } }
public string showData() { StringBuilder stringBuilder = new StringBuilder(); JpArticle JpArticle = new JpArticle(); string ls_where = " and cid = '" + this.txtcid.Value + "' and sfzwd='是'"; string ls_order = " order by pubtime desc"; DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, 1, 3); JpColumns jpColumns = new JpColumns(); DataTable dt_column = jpColumns.GetColumnBycid(this.txtcid.Value); string strCloumnName = dt_column.Rows[0]["cname"].ToString(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { string ls_zwdid = dt.Rows[i]["aid"].ToString(); if (dt.Rows[i]["indexdisplaypicpath"].ToString() != "") { stringBuilder.Append("<li><div class='jptx'><a onclick=\"locationDetail('art_detail.aspx?aid=" + dt.Rows[i]["aid"].ToString() + "&cid=" + this.txtcid.Value + "','" + locationType + "','1')\" ><div class='jptxpp'><img src=\"" + dt.Rows[i]["indexdisplaypicpath"].ToString() + "\">"); } else { stringBuilder.Append("<li><div class='jptx'><a onclick=\"locationDetail('art_detail.aspx?aid=" + dt.Rows[i]["aid"].ToString() + "&cid=" + this.txtcid.Value + "','" + locationType + "','1')\" ><div class='jptxpp'>" + dt.Rows[i]["title"].ToString() + ""); } stringBuilder.Append("<div class=\"jptxbt\">" + dt.Rows[i]["title"].ToString() + "</div></div></a>"); string ls_where2 = " and cid = '" + this.txtcid.Value + "' and zwdid='" + ls_zwdid + "' and sfzwd='否' "; string ls_order2 = " order by pubtime desc"; DataTable dt_zwd = JpArticle.SearchdocsByKey(ls_where2, ls_order2, 1, 6); if (dt_zwd.Rows.Count > 0) { for (int j = 0; j < dt_zwd.Rows.Count; j++) { stringBuilder.Append("<a onclick=\"locationDetail('art_detail.aspx?aid=" + dt_zwd.Rows[j]["aid"].ToString() + "','" + locationType + "','1')\" ><div class=\"jptxsub\"><p>" + dt_zwd.Rows[j]["title"].ToString() + "</p>"); if (dt_zwd.Rows[j]["map_cid"].ToString() != "") { stringBuilder.Append("<i class=\"ico-sd\">" + dt_zwd.Rows[j]["map_cid"].ToString() + "</i>"); } stringBuilder.Append("</a></div></a>"); } } stringBuilder.Append("</div></li>"); } } return stringBuilder.ToString(); }
private void DataPlay() { if (this.Request.QueryString["op"] != null) { this.txtop.Value = this.Request.QueryString["op"].ToString(); //新增还是修改 } if (this.Request.QueryString["id"] != null) { this.txtcid.Text = this.Request.QueryString["id"].ToString(); //部门ID } if (this.Request.QueryString["lastid"] != null) { this.txtlastcid.Value = this.Request.QueryString["lastid"].ToString(); //上级部门ID } TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); //新文档 if (this.txtop.Value == "add") { this.txtcid.Text = JpColumns.GetMaxCid(txtlastcid.Value); this.txtcid.Enabled = false; } //旧文档 if (this.txtop.Value == "modify") { DataTable dt = JpColumns.GetColumnBycid(this.txtcid.Text); if (dt.Rows.Count > 0) { this.txtcname.Text = dt.Rows[0]["cname"].ToString(); this.txtcsort.Text = dt.Rows[0]["csort"].ToString(); this.ddltmp_col.SelectedValue = dt.Rows[0]["tmp_col"].ToString(); this.ddltmp_art.SelectedValue = dt.Rows[0]["tmp_art"].ToString(); this.txtpubhtmlpath.Text = dt.Rows[0]["pubhtmlpath"].ToString(); this.txtrss.Text = dt.Rows[0]["rss"].ToString(); this.txtnewday.Text = dt.Rows[0]["newday"].ToString(); // this.txtnewpic.Text = dt.Rows[0]["newpic"].ToString(); if (dt.Rows[0]["newpic"].ToString() != "") { this.txtpicurl.Value = dt.Rows[0]["newpic"].ToString(); this.lblpic.Text = "<img src='" + dt.Rows[0]["newpic"].ToString() + "' onError=\"this.src='/images/index/images/nophoto.jpg';\" width=60px height=55px />"; } this.txtseotitle.Text = dt.Rows[0]["seotitle"].ToString(); this.txtseokeywords.Text = dt.Rows[0]["seokeywords"].ToString(); this.txtseodescription.Text = dt.Rows[0]["seodescription"].ToString(); if (dt.Rows[0]["online"].ToString() == "1") { cblsx.Items[0].Selected = true; } else { cblsx.Items[0].Selected = false; } if (dt.Rows[0]["hotpublish"].ToString() == "1") { cblsx.Items[1].Selected = true; } else { cblsx.Items[1].Selected = false; } if (dt.Rows[0]["shtml"].ToString() == "1") { cblsx.Items[2].Selected = true; } else { cblsx.Items[2].Selected = false; } if (dt.Rows[0]["pubtime"].ToString() == "1") { cblsx.Items[3].Selected = true; } else { cblsx.Items[3].Selected = false; } } } }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); //if (this.Request.QueryString["deptid"] != null) // this.deptid = this.Request.QueryString["deptid"].ToString(); if (this.Request.QueryString["keywords"] != null) this.keywords = this.Request.QueryString["keywords"].ToString(); if (this.Request.QueryString["cid"] != null) { this.cid = this.Request.QueryString["cid"].ToString(); this.txtcid.Text = this.Request.QueryString["cid"].ToString(); } this.pageSize = 10; //每页数量 if (!Page.IsPostBack) { //DeptBind(this.cid); //绑定栏目 //判断权限 TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); if (JpRoles.ifhaveAuthorRoleBycidanduid(this.Session["uid"].ToString(), this.cid) != true) { this.Response.Write("<script>alert('你没有该栏目的编辑权限,请联系管理员!');</script>"); return; } TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); DataTable dtcol = JpColumns.GetColumnBycid(this.cid); if (dtcol.Rows[0]["hotpublish"].ToString() == "1") { this.tdnewdoc.Visible = false; } TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser(); if (JpRoleuser.isHaveRole("Role9999", this.Session["uid"].ToString()) == true) { btnDelete.Visible = true; } else { btnDelete.Visible = false; } RptBind(); } }
private void DataPlay() { if (this.Request.QueryString["op"] != null) { this.txtop.Value = this.Request.QueryString["op"].ToString(); //新增还是修改 } if (this.Request.QueryString["aid"] != null) { this.txtaid.Text = this.Request.QueryString["aid"].ToString(); //文章ID } if (this.Request.QueryString["cid"] != null) { this.txtcid.Text = this.Request.QueryString["cid"].ToString(); //栏目ID if (this.txtcid.Text.Contains(",")) this.txtcid.Text = this.txtcid.Text.Substring(0, this.txtcid.Text.IndexOf(",")); } TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle(); //新文档 if (this.txtop.Value == "add") { this.txtendtime.Text = System.DateTime.Now.AddYears(10).ToString(); this.txtpubtime.Text = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); this.txtguid.Text = System.Guid.NewGuid().ToString(); //直接返回字符串类型 this.txttopendtime.Value = System.DateTime.Now.AddDays(5).ToString("yyyy-MM-dd"); //this.ddlcolname.SelectedValue = this.cid; //根据栏目ID得到栏目名称start TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); DataTable dtcols = JpColumns.GetColumnBycid(this.cid); this.txtcolname.Text = dtcols.Rows[0]["cname"].ToString(); //根据栏目ID得到栏目名称end this.txtauthor.Text = this.Session["uname"].ToString(); DataTable dtsort = JpArticle.Getmaxsort(); if (dtsort.Rows.Count > 0) { this.txtasort.Text = (System.Int32.Parse(dtsort.Rows[0]["asort"].ToString()) + 2).ToString(); } else { this.txtasort.Text = "1"; } } //旧文档 if (this.txtop.Value == "modify") { DataTable dt = JpArticle.GetArticleByaid(System.Int32.Parse(this.txtaid.Text)); if (dt.Rows.Count > 0) { this.txtendtime.Text = dt.Rows[0]["endtime"].ToString(); this.txtpubtime.Text = dt.Rows[0]["pubtime"].ToString(); //根据栏目ID得到栏目名称start TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); DataTable dtcols = JpColumns.GetColumnBycid(dt.Rows[0]["cid"].ToString()); this.txtcolname.Text = dtcols.Rows[0]["cname"].ToString(); //根据栏目ID得到栏目名称end this.txttitle.Text = dt.Rows[0]["title"].ToString(); this.txttitle2.Text = dt.Rows[0]["subhead"].ToString(); this.content1.Value = dt.Rows[0]["ht_content"].ToString(); this.txtauthor.Text = dt.Rows[0]["author"].ToString(); this.txtsummary.Text = dt.Rows[0]["summary"].ToString(); this.txtsummary.Text = dt.Rows[0]["summary"].ToString(); this.txtseotitle.Text = dt.Rows[0]["seotitle"].ToString(); this.txtseokeywords.Text = dt.Rows[0]["seokeywords"].ToString(); this.txtseodescription.Text = dt.Rows[0]["seodescription"].ToString(); this.txtasort.Text = dt.Rows[0]["asort"].ToString(); ; this.txttopendtime.Value = DateTime.Parse(dt.Rows[0]["topendtime"].ToString()).ToString("yyyy-MM-dd"); this.txtsource.Value = dt.Rows[0]["source"].ToString(); this.txtguid.Text = dt.Rows[0]["GUID"].ToString(); this.txtrole_userid.Text = dt.Rows[0]["role_userid"].ToString(); ; this.txtrole_username.Text = dt.Rows[0]["role_username"].ToString(); this.txtpic.Value = dt.Rows[0]["indexdisplaypicpath"].ToString(); if (dt.Rows[0]["map_cid"].ToString() != "") { ddllb.SelectedValue = dt.Rows[0]["map_cid"].ToString(); } if (dt.Rows[0]["indexdisplaypicpath"].ToString() != "") { this.lblpic.Text = "<img src='" + dt.Rows[0]["indexdisplaypicpath"].ToString() + "' onError=\"this.src='/images/nophoto.jpg';\" width=60px height=55px />"; } else { this.lblpic.Text = ""; } this.ddlsfzd.SelectedValue = dt.Rows[0]["iftop"].ToString(); if (dt.Rows[0]["iftop"].ToString() == "1") { ls_xs1 = "inline"; } this.ddlsfsyss.SelectedValue = dt.Rows[0]["ifindexdisplay"].ToString(); if (dt.Rows[0]["ifindexdisplay"].ToString() == "1") { ls_xs2 = "inline"; } if (dt.Rows[0]["sfzwd"].ToString() == "否") { radlist.SelectedValue = "否"; ls_xs3 = ""; ddlwz.SelectedValue = dt.Rows[0]["zwdid"].ToString(); } } } }
protected void Page_Load(object sender, EventArgs e) { //获取参数 string ls_aid = "", ls_cid = "", ls_page = "1", ls_pagesize = "10"; JpCommon JpCommon = new JpCommon(); if (this.Request.QueryString["cid"] != null) ls_cid = JpCommon.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9); if (this.Request.QueryString["aid"] != null) ls_aid = JpCommon.queryString2StrID(this.Request.QueryString["aid"].ToString(), 9); if (this.Request.QueryString["page"] != null) ls_page = JpCommon.queryString2StrID(this.Request.QueryString["page"].ToString(), 9); if (this.Request.QueryString["pagesize"] != null) ls_pagesize = JpCommon.queryString2StrID(this.Request.QueryString["pagesize"].ToString(), 9); StringBuilder stringBuilder = new StringBuilder(); JpArticle JpArticle = new JpArticle(); string ls_where = " and cid = '" + ls_cid + "' "; string ls_order = " order by pubtime desc"; DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, Convert.ToInt32(ls_page), Convert.ToInt32(ls_pagesize)); JpColumns jpColumns = new JpColumns(); string strColumnName = ""; stringBuilder.Append("["); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DataTable dt_columns = jpColumns.GetColumnBycid(dt.Rows[i]["cid"].ToString()); if (dt_columns.Rows.Count > 0) { strColumnName = dt_columns.Rows[0]["cname"].ToString(); } string ls_zwdid = dt.Rows[i]["aid"].ToString(); stringBuilder.Append("{\"aid\":\"" + dt.Rows[i]["aid"].ToString() + "\",\"cid\":\"" + dt.Rows[i]["cid"].ToString() + "\",\"cname\":\"" + strColumnName + "\",\"indexdisplaypicpath\":\"" + dt.Rows[i]["indexdisplaypicpath"].ToString() + "\",\"title\":\"" + dt.Rows[i]["title"].ToString() + "\",\"showTime\":\"" + JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["crtime"].ToString())) + "\",\"child\":["); string ls_where2 = " and cid = '" + ls_cid + "' and zwdid='" + ls_zwdid + "' and sfzwd='否' "; string ls_order2 = " order by pubtime desc"; DataTable dt_zwd = JpArticle.SearchdocsByKey(ls_where2, ls_order2, Convert.ToInt32(ls_page), Convert.ToInt32(ls_pagesize)); if (dt_zwd.Rows.Count > 0) { for (int j = 0; j < dt_zwd.Rows.Count; j++) { stringBuilder.Append("{\"aid\":\"" + dt_zwd.Rows[j]["aid"].ToString() + "\",\"cid\":\"" + dt.Rows[i]["cid"].ToString() + "\",\"cname\":\"" + strColumnName + "\",\"indexdisplaypicpath\":\"" + dt_zwd.Rows[j]["indexdisplaypicpath"].ToString() + "\",\"map_cid\":\"" + dt_zwd.Rows[j]["map_cid"].ToString() + "\",\"title\":\"" + dt_zwd.Rows[j]["title"].ToString() + "\",\"showTime\":\"" + JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt_zwd.Rows[j]["crtime"].ToString())) + "\""); if (j == dt_zwd.Rows.Count - 1) { stringBuilder.Append("}"); } else { stringBuilder.Append("},"); } } } stringBuilder.Append("]"); if (dt.Rows.Count - 1 == i) { stringBuilder.Append("}"); } else { stringBuilder.Append("},"); } } } stringBuilder.Append("]"); //数据抛出 Response.Write(stringBuilder.ToString()); }
/// <summary> /// 根据传入的条件显示新闻列表 /// </summary> /// <param name="pis_cid">栏目ID</param> /// <param name="pis_sfzwd">是否主文档</param> /// <param name="pis_iftop">是否置顶</param> /// <param name="num">显示数量</param> /// <returns></returns> public string NewsLists(string pis_cid, string pis_sfzwd, string pis_iftop, int page, int pagesize) { StringBuilder stringBuilder = new StringBuilder(); string ls_return = "", ls_form = "art_detail.aspx"; int k = 0; TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string ls_where = " and cid like '" + pis_cid + "%' "; //专栏 if (pis_cid == "003") { ls_where = " and cid like '" + pis_cid + "%' and cid <> '003004' "; } if (pis_sfzwd != "") { ls_where += " and sfzwd='" + pis_sfzwd + "' "; } if (pis_sfzwd == "是") { ls_form = "column_list_more.aspx"; } if (pis_iftop != "") { ls_where += " and iftop='" + pis_iftop + "' "; } string ls_order = " order by pubtime desc"; DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, page, pagesize); string onclickType = ""; JpColumns jpColumns = new JpColumns(); DataTable dtColumns = jpColumns.GetColumnBycid(pis_cid); string strColumnName = ""; if (dtColumns.Rows.Count > 0) { strColumnName = dtColumns.Rows[0]["cname"].ToString(); } if (dt.Rows.Count > 0) { if (dt.Rows.Count > pagesize) { k = pagesize; } else { k = dt.Rows.Count; } JpComment jpComment = new JpComment(); for (int i = 0; i < k; i++) { string ls_aid = dt.Rows[i]["aid"].ToString(); string ls_cid = dt.Rows[i]["cid"].ToString(); string ls_title = dt.Rows[i]["title"].ToString(); string ls_pic = dt.Rows[i]["indexdisplaypicpath"].ToString(); string ls_goodnum = dt.Rows[i]["goodnum"].ToString(); string ls_url = ls_form + "?aid=" + ls_aid + "&cid=" + ls_cid + "&rnd=" + System.Guid.NewGuid().ToString(); int commentCount = 0; commentCount = jpComment.GetdocsbyaidAllCount(ls_aid, ls_cid); DateTime ls_date = DateTime.Parse(dt.Rows[i]["pubtime"].ToString()); DateTime ls_now = DateTime.Now; string ls_time = JpCommon.DateDiff(ls_now, ls_date); string strArtType = "0"; if (ls_form == "art_detail.aspx") { strArtType = "1"; } if (pis_sfzwd == "是") { onclickType = "locationList('" + ls_url + "','" + locationType + "','" + strColumnName + "')"; } else { onclickType = "locationDetail('" + ls_url + "','" + locationType + "','" + strArtType + "')"; } stringBuilder.Append("<li><a onclick=\"" + onclickType + "\" href=\"javascript:void(0)\"><img src=\"images/loading.gif\" data-original=\"" + ls_pic + "\" onError=\"this.src='images/nophoto.jpg';\"><h2>" + ls_title + "</h2>"); stringBuilder.Append("<p class=\"fleft\"><span>" + ls_time + "</span></p><p class=\"fright\"><i class=\"ico-pl2\"></i><span>" + commentCount + "</span></p></a></li>"); } } ls_return = stringBuilder.ToString(); stringBuilder.Remove(0, stringBuilder.Length); return ls_return; }