public string getData() { TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); DataTable dt = JpColumns.GetFirstlevcolumns_online(); StringBuilder strShow = new StringBuilder(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级文章目录 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { //如果需要显示这个栏目(当前栏目有权限要显示,如果当前栏目没权限但是下级栏目有权限也要显示但是不加载链接) if (JpRoles.ifhaveEditorRoleBycidanduid_containsubcid("admin", dt.Rows[i]["cid"].ToString()) == true) { strShow.Append("<li class=\"mui-table-view-cell mui-collapse\"><a class=\"mui-navigate-right\" href=\"javascript:void(0)\">" + dt.Rows[i]["cname"].ToString() + "</a>"); strShow.Append("<ul class=\"mui-table-view mui-table-view-chevron\">"); strShow.Append(GetNextColumn(dt.Rows[i]["cid"].ToString())); strShow.Append("</ul>"); strShow.Append("</li>"); } } else { if (JpRoles.ifhaveEditorRoleBycidanduid("admin", dt.Rows[i]["cid"].ToString()) == true) { strShow.Append("<li class=\"mui-table-view-cell mui-collapse\"><a class=\"mui-navigate-right\" href=\"javascript:void(0)\">" + dt.Rows[i]["cname"].ToString() + "</a></li>"); } } } } return strShow.ToString(); }
//静态发布栏目和内容页 protected void btnpub3_Click(object sender, EventArgs e) { try { TPortalClass.JpSite site = new TPortalClass.JpSite(); TPortalClass.JpShtml jpshtml = new TPortalClass.JpShtml(); TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); DataTable dt_col = JpColumns.GetColumnsOnline(); if (dt_col.Rows.Count > 0) { for (int i = 0; i < dt_col.Rows.Count; i++) { if (dt_col.Rows[i]["shtml"].ToString() == "1") //静态发布的栏目 { TPortalClass.JpColumns pubcol = new TPortalClass.JpColumns(dt_col.Rows[i]["cid"].ToString()); pubcol.shtmlpublish(2, int.Parse(txtdays.Value)); } } } Response.Write("<script language=javascript>alert('发布成功!');window.location='pubhtml.aspx';</script>"); } catch { Response.Write("<script language=javascript>alert('发布失败!');window.location='pubhtml.aspx';</script>"); } finally { } }
private string GetNextColumn(string pis_cid) { string ls_return = ""; //得到下级文章目录 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); DataTable dt = JpColumns.GetSubColumnsOrderbysort_online(pis_cid); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级部门 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { if (JpRoles.ifhaveEditorRoleBycidanduid_containsubcid("admin", dt.Rows[i]["cid"].ToString()) == true) { if (JpRoles.ifhaveEditorRoleBycidanduid("admin", dt.Rows[i]["cid"].ToString()) == true) { if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { ls_return += "<li class=\"mui-table-view-cell\">"; } else { ls_return += "<li class=\"mui-table-view-cell\" ><a class=\"mui-navigate-right\" href=\"auditSecondList.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "&rend=" + System.Guid.NewGuid().ToString() + "\" ><span class=\"mui-badge mui-badge-warning\">2</span>"; } } else { ls_return += "<li class=\"mui-table-view-cell\">"; } ls_return += dt.Rows[i]["cname"].ToString() + "</a>"; ls_return += "<ul>"; ls_return += GetNextColumn(dt.Rows[i]["cid"].ToString()); ls_return += "</ul>"; ls_return += "</li>"; } } else { if (JpRoles.ifhaveEditorRoleBycidanduid("admin", dt.Rows[i]["cid"].ToString()) == true) { ls_return += "<li class=\"mui-table-view-cell\" ><a class=\"mui-navigate-right\" href=\"auditSecondList.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "&rend=" + System.Guid.NewGuid().ToString() + "\" >" + dt.Rows[i]["cname"].ToString() + "<span class=\"mui-badge mui-badge-warning\">2</span></a></li>"; } } } } return ls_return; }
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(); }
//上线下线 protected void btncolrfb_Click(object sender, EventArgs e) { //CheckBox chkonline = //e.Item.FindControl("chkonline") as CheckBox; TPortalClass.JpColumns col = new TPortalClass.JpColumns(); col.cid = this.txtcid.Text; if (this.txtisrfb.Text == "true") col.hotpublish = "1"; else col.hotpublish = "0"; col.UpdateRfb(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string pageUrl = JpCommon.CombUrlTxt("list_columns.aspx", "page={0}&rnd={1}&cid={2}", "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid_url.Text + ""); Response.Write("<script>window.location='" + pageUrl + "';</script>"); }
//显示栏目管理 public string ls_lmgl() { string ls_return = ""; if (Session["uid"].ToString() == "") { } else { DataTable dt = new DataTable(); //文章发布左侧动态产生 //得到一级部门 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); dt = JpColumns.GetFirstlevcolumns_online(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { ls_return += "<li url=\"column/list_columns.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\"><span>"; ls_return += dt.Rows[i]["cname"].ToString() + "</span></li>"; } } } return ls_return; }
//显示文章发布栏目 public string ls_wzfb() { string ls_return = ""; if (Session["uid"].ToString() == "") { } else { DataTable dt = new DataTable(); //文章发布左侧动态产生 //得到一级部门 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); dt = JpColumns.GetFirstlevcolumns_online(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级部门 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { //如果需要显示这个栏目(当前栏目有权限要显示,如果当前栏目没权限但是下级栏目有权限也要显示但是不加载链接) if (JpRoles.ifhaveEditorRoleBycidanduid_containsubcid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { if (JpRoles.ifhaveEditorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { ls_return += "<li isexpand=\"false\" >"; } else { ls_return += "<li isexpand=\"false\">"; } ls_return += "<span>" + dt.Rows[i]["cname"].ToString() + "</span>"; ls_return += "<ul>"; ls_return += GetNextColumn(dt.Rows[i]["cid"].ToString()); ls_return += "</ul>"; ls_return += "</li>"; } } else { if (JpRoles.ifhaveEditorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { ls_return += "<li url=\"article/list_article_fb.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "&rnd=" + System.Guid.NewGuid().ToString() + "\"><span>"; ls_return += dt.Rows[i]["cname"].ToString() + "</span></li>"; } } } } } return ls_return; }
//#region 检查权限================================= //private void ChkRole(string Roleid) //{ // TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser(); // if (JpRoleuser.isHaveRole(Roleid, this.Session["uid"].ToString()) == true || JpRoleuser.isHaveRole("Role9999", this.Session["uid"].ToString()) == true) // { // btnpub1.Visible = true; // btnpub2.Visible = true; // btnpub3.Visible = true; // btnpub4.Visible = true; // } // else // { // btnpub1.Visible = false; // btnpub2.Visible = false; // btnpub3.Visible = false; // btnpub4.Visible = false; // } //} //#endregion private void DataPlay() { TPortalClass.JpPubHtml JpPubHtml = new TPortalClass.JpPubHtml(); txtid.Text = JpPubHtml.id; txtpages.Text = JpPubHtml.pages; txtdays.Value = JpPubHtml.days; //staticstatus.SelectedValue = JpPubHtml.status; TextBox1.Text = JpPubHtml.status; //if (staticstatus.SelectedValue == "关闭") //{ // tr1.Visible = false; // tr2.Visible = false; // tr3.Visible = false; // tr4.Visible = false; //} if (txtid.Text == "") { txtop.Text = "add"; txtid.Text = System.Guid.NewGuid().ToString(); } else { txtop.Text = "modify"; } //加载一级栏目 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); DataTable dt_col = JpColumns.GetColumnsOnline(); int j = 1; this.ddlcol.Items.Insert(0, new ListItem("--请选择--", "")); if (dt_col.Rows.Count > 0) { for (int i = 0; i < dt_col.Rows.Count; i++) { if (dt_col.Rows[i]["shtml"].ToString() == "1" && dt_col.Rows[i]["cid"].ToString().Length == 3) //静态发布的栏目 { this.ddlcol.Items.Insert(j, new ListItem(dt_col.Rows[i]["cname"].ToString(), dt_col.Rows[i]["cid"].ToString())); j = j + 1; } } } }
//保存操作 protected void btnsave_Click(object sender, EventArgs e) { TPortalClass.JpPubHtml JpPubHtml = new TPortalClass.JpPubHtml(); TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); JpPubHtml.id = txtid.Text; JpPubHtml.pages = txtpages.Text; if (txtdays.Value != "") { JpPubHtml.days = txtdays.Value; } else { JpPubHtml.days = "0"; } JpPubHtml.status = staticstatus.SelectedValue; //string ls_bzw = "0"; //if (staticstatus.SelectedValue == "开启") //{ // ls_bzw = "1"; //} //JpColumns.shtml = ls_bzw; JpPubHtml.status = TextBox1.Text; if (txtop.Text == "add") { if (JpPubHtml.Insert()) { //更新栏目中是否开启静态关闭功能标志位 //JpColumns.UpdateJtfb_plcl(); Response.Write("<script language=javascript>alert('保存成功!');window.location='pubhtml.aspx';</script>"); return; } else { Response.Write("<script language=javascript>alert('保存失败!');window.location='pubhtml.aspx';</script>"); return; } } else { if (JpPubHtml.Update()) { //更新栏目中是否开启静态关闭功能标志位 //JpColumns.UpdateJtfb_plcl(); Response.Write("<script language=javascript>alert('保存成功!');window.location='pubhtml.aspx';</script>"); return; } else { Response.Write("<script language=javascript>alert('保存失败!');window.location='pubhtml.aspx';</script>"); return; } } }
//静态发布指定的栏目和内容页 protected void btnpub4_Click(object sender, EventArgs e) { try { if (ddlcol.SelectedValue.ToString() != "") { TPortalClass.JpColumns pubcol = new TPortalClass.JpColumns(ddlcol.SelectedValue.ToString()); pubcol.shtmlpublish(2, int.Parse(txtdays.Value)); //得到子栏目进行发布 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); DataTable dt_col = JpColumns.GetAllSubonlineColumns(ddlcol.SelectedValue.ToString()); if (dt_col.Rows.Count > 0) { for (int i = 0; i < dt_col.Rows.Count; i++) { TPortalClass.JpColumns pubcol_sub = new TPortalClass.JpColumns(dt_col.Rows[i]["cid"].ToString()); pubcol_sub.shtmlpublish(2, int.Parse(txtdays.Value)); } } Response.Write("<script language=javascript>alert('发布成功!');window.location='pubhtml.aspx';</script>"); } else { Response.Write("<script language=javascript>alert('请选择需要栏目!');window.location='pubhtml.aspx';</script>"); } } catch { Response.Write("<script language=javascript>alert('发布失败!');window.location='pubhtml.aspx';</script>"); } finally { } }
private void RptBind() { if (this.Request.QueryString["page"] != null) this.page = int.Parse(this.Request.QueryString["page"].ToString()); else this.page = 1; txtPageNum.Text = this.pageSize.ToString(); txtPage.Text = this.page.ToString(); string uid = txtuid.Text; string cid = txtcid.Text; TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); DataTable dt = new DataTable(); if (this.txtcid.Text == "") dt = JpColumns.GetFirstlevcolumns_online(); else dt = JpColumns.GetSubColumnsOrderbysort_online(this.txtcid.Text); this.totalCount = dt.Rows.Count; DataTable tempTable = dt.Clone(); tempTable.Columns.Add(new DataColumn("authorchecked", typeof(string))); tempTable.Columns.Add(new DataColumn("editorchecked", typeof(string))); for (int i = (this.page - 1) * this.pageSize; i < this.page * this.pageSize; i++) { if (i > dt.Rows.Count - 1) break; DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } if (JpRoles.ifhaveAuthorRoleBycidanduid(this.txtuid.Text, dt.Rows[i]["cid"].ToString()) == true) dr["authorchecked"] = "checked"; else dr["authorchecked"] = ""; if (JpRoles.ifhaveEditorRoleBycidanduid(this.txtuid.Text, dt.Rows[i]["cid"].ToString()) == true) dr["editorchecked"] = "checked"; else dr["editorchecked"] = ""; tempTable.Rows.Add(dr); } this.rptList.DataSource = tempTable; this.rptList.DataBind(); //翻页 //string pageUrl = Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}", // this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property, "__id__"); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string pageUrl = JpCommon.CombUrlTxt("main_columnrole.aspx", "page={0}&rnd={1}&cid={2}&uid={3}", "__id__", System.Guid.NewGuid().ToString(), cid, uid); PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
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; } } } }
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(); } } } }
//得到下一级部门的信息 private void GetNextColumn(string pis_cid) { //得到二级部门 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); DataTable dt = JpColumns.GetSubColumnsOrderbysort_online(pis_cid); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级部门 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { //输出二级部门头部 Response.Write("<dd class=\"folderClose\">"); Response.Write("<a href=\"../settings/main_columnrole.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "&uid=" + ls_uid + "&rnd=" + System.Guid.NewGuid().ToString() + "\" target=\"RightIframeWin\">"); Response.Write(dt.Rows[i]["cname"].ToString()); Response.Write("</a>"); Response.Write("<dl>"); GetNextColumn(dt.Rows[i]["cid"].ToString()); //输出二级部门尾部 Response.Write("</dl>"); Response.Write("</dd>"); } else { Response.Write("<dt>"); Response.Write("<a href=\"../settings/main_columnrole.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "&uid=" + ls_uid + "&rnd=" + System.Guid.NewGuid().ToString() + "\" target=\"RightIframeWin\">"); Response.Write(dt.Rows[i]["cname"].ToString()); Response.Write("</a>"); Response.Write("</dt>"); } } } }
private void DeptBind(string cid) { TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); DataTable dt = new DataTable(); dt = JpColumns.GetColumns(""); DataTable tempTable = dt.Clone(); for (int i = 0; i < dt.Rows.Count; i++) { addsubcolumn(tempTable, dt.Rows[i]["cid"].ToString(), dt.Rows[i]["cname"].ToString()); } ddlcolname.DataSource = tempTable; ddlcolname.DataTextField = "cname"; ddlcolname.DataValueField = "cid"; ddlcolname.DataBind(); }
private void addsubcolumn(DataTable tempTable, string pi_cid, string pi_cname) { //先插入当前栏目 DataRow dr = tempTable.NewRow(); dr["cid"] = pi_cid; dr["cname"] = pi_cname; tempTable.Rows.Add(dr); //判断是否有下级栏目 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); DataTable dt = new DataTable(); dt = JpColumns.GetColumns(pi_cid); if (dt.Rows.Count > 0) { //有下一级目录 for (int i = 0; i < dt.Rows.Count; i++) { addsubcolumn(tempTable, dt.Rows[i]["cid"].ToString(), pi_cname + ">>" + dt.Rows[i]["cname"].ToString()); } } }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); string ls_tip = "删除成功!"; for (int i = 0; i < rptList.Items.Count; i++) { //int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value; CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { //判断是否还有子栏目,如果有子栏目不能删除 DataTable dt_sub = JpColumns.GetSubColumnsOrderbysort_online(id); if (dt_sub.Rows.Count > 0) { ls_tip = "有下一级栏目的信息无法删除,请先删除下一级栏目!"; } else { JpColumns.cid = id; JpColumns.Delete(); } } } string pageUrl = JpCommon.CombUrlTxt("list_columns.aspx", "page={0}&rnd={1}&cid={2}", "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid_url.Text + ""); //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "删除", "批量删除栏目记录", Session["uid"].ToString(), Session["uname"].ToString()); Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>"); }
private void RptBind() { if (this.Request.QueryString["page"] != null) this.page = int.Parse(this.Request.QueryString["page"].ToString()); else this.page = 1; if (this.Request.QueryString["cid"] != null) this.txtcid_url.Text = this.Request.QueryString["cid"].ToString(); //this.txtKeywords.Text = this.keywords; txtPageNum.Text = this.pageSize.ToString(); txtPage.Text = this.page.ToString(); TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); DataTable dt = new DataTable(); dt = JpColumns.GetColumns_tree_all(this.txtcid_url.Text); this.totalCount = dt.Rows.Count; DataTable tempTable = dt.Clone(); for (int i = (this.page - 1) * this.pageSize; i < this.page * this.pageSize; i++) { if (i > dt.Rows.Count - 1) break; DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } tempTable.Rows.Add(dr); } rptList.DataSource = tempTable; rptList.DataBind(); //翻页 //string pageUrl = Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}", // this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property, "__id__"); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string pageUrl = JpCommon.CombUrlTxt("list_columns.aspx", "page={0}&rnd={1}&cid={2}", "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid_url.Text + ""); PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//保存排序 protected void btnSave_Click(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); for (int i = 0; i < rptList.Items.Count; i++) { //int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value; int sortId; if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } JpColumns.Updatecolumnsort(id, sortId); } string pageUrl = JpCommon.CombUrlTxt("list_columns.aspx", "page={0}&rnd={1}&cid={2}", "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid_url.Text + ""); //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "保存排序", "批量保存栏目排序号", Session["uid"].ToString(), Session["uname"].ToString()); Response.Write("<script>alert('保存排序成功!');window.location='" + pageUrl + "';</script>"); }
private void addsubcolumn(DataTable tempTable, string pi_cid, string pi_cname) { TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); //先插入当前栏目 DataRow dr = tempTable.NewRow(); dr["cid"] = pi_cid; dr["cname"] = pi_cname; if (JpRoles.ifhaveAuthorRoleBycidanduid(Session["uid"].ToString(), pi_cid) == true && JpColumns.ifhotpublish(pi_cid) == false) { //有下一级 if (JpColumns.isHaveSubColumn_online(pi_cid) == true) { } else { tempTable.Rows.Add(dr); } } //判断是否有下级栏目 DataTable dt = new DataTable(); dt = JpColumns.GetColumns(pi_cid); if (dt.Rows.Count > 0) { //有下一级目录 for (int i = 0; i < dt.Rows.Count; i++) { addsubcolumn(tempTable, dt.Rows[i]["cid"].ToString(), pi_cname + ">>" + dt.Rows[i]["cname"].ToString()); } } }
//显示文章投稿栏目 public string ls_wztg() { string ls_return = ""; if (Session["uid"].ToString() == "") { } else { DataTable dt = new DataTable(); //文章发布左侧动态产生 //得到一级部门 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); dt = JpColumns.GetFirstlevcolumns_online(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级部门 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { if (JpRoles.ifshowcolumn_tg(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { if (JpRoles.ifhaveAuthorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true && JpColumns.ifhotpublish(dt.Rows[i]["cid"].ToString()) == false) { ls_return += "<li isexpand=\"false\" url=\"article/list_article_tg.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\">"; } else { ls_return += "<li isexpand=\"false\">"; } ls_return += "<span>" + dt.Rows[i]["cname"].ToString() + "</span>"; ls_return += "<ul>"; ls_return += GetNextColumn_author(dt.Rows[i]["cid"].ToString()); ls_return += "</ul>"; ls_return += "</li>"; } } else { if (JpRoles.ifhaveAuthorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true && JpColumns.ifhotpublish(dt.Rows[i]["cid"].ToString()) == false) { ls_return += "<li url=\"article/list_article_tg.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\"><span>"; ls_return += dt.Rows[i]["cname"].ToString() + "</span></li>"; } } } } } return ls_return; }
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()); }
//商城管理 public string ls_scgl() { TPortalClass.DAO db = new TPortalClass.DAO(); string ls_return = ""; if (Session["uid"].ToString() == "") { } else { TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); if (JpRoles.ifshowcolumn_tg(Session["uid"].ToString(), "006")) { ls_return += "<li isexpand=\"false\"><span>商城投稿</span>"; ls_return += "<ul>"; #region DataTable dt = new DataTable(); //文章发布左侧动态产生 //得到一级部门 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); string sql_Firstlevcolumns = "Select * from JpColumns where len(cid)=6 and cid like '006%' and online=1 order by csort "; dt = db.GetDataTable(sql_Firstlevcolumns); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级部门 string sql_isHaveSubColumn = " select * from JpColumns where cid like '" + dt.Rows[i]["cid"].ToString() + "%' and len(cid) = 9 and online = 1 order by csort "; DataTable dt_isHaveSbuColumn = db.GetDataTable(sql_isHaveSubColumn); bool b_isHaveSbuColumn; if (dt_isHaveSbuColumn.Rows.Count > 0) { b_isHaveSbuColumn = true; } else { b_isHaveSbuColumn = false; } if (b_isHaveSbuColumn == true) { string sql_ifshowcolumn = " select * from JpRoles a,JpColumns b where a.cid=b.cid and a.role='author' and a.uid='" + Session["uid"].ToString() + "' and a.cid like '" + dt.Rows[i]["cid"].ToString() + "%' "; DataTable dt_ifshowcolumn = db.GetDataTable(sql_isHaveSubColumn); bool b_ifshowcolumn; if (dt_ifshowcolumn.Rows.Count > 0) { b_ifshowcolumn = true; } else { b_ifshowcolumn = false; } if (b_ifshowcolumn == true) { string sql_ifhaveAuthorRoleBycidanduid = " select * from JpRoles where role='author' and uid='" + Session["uid"].ToString() + "' and cid='" + dt.Rows[i]["cid"].ToString() + "' "; DataTable dt_ifhaveAuthorRoleBycidanduid = db.GetDataTable(sql_isHaveSubColumn); bool b_ifhaveAuthorRoleBycidanduid; if (dt_ifhaveAuthorRoleBycidanduid.Rows.Count > 0) { b_ifhaveAuthorRoleBycidanduid = true; } else { b_ifhaveAuthorRoleBycidanduid = false; } if (b_ifhaveAuthorRoleBycidanduid == true) { ls_return += "<li isexpand=\"false\" url=\"shop/list_shop_tg.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\">"; } else { ls_return += "<li isexpand=\"false\">"; } ls_return += "<span>" + dt.Rows[i]["cname"].ToString() + "</span>"; ls_return += "<ul>"; ls_return += GetShopNextColumn_author(dt.Rows[i]["cid"].ToString()); ls_return += "</ul>"; ls_return += "</li>"; } } else { DataTable dt_ifhaveAuthorRoleBycidanduid = db.GetDataTable(sql_isHaveSubColumn); bool b_ifhaveAuthorRoleBycidanduid; if (dt_ifhaveAuthorRoleBycidanduid.Rows.Count > 0) { b_ifhaveAuthorRoleBycidanduid = true; } else { b_ifhaveAuthorRoleBycidanduid = false; } if (b_ifhaveAuthorRoleBycidanduid == true) { ls_return += "<li url=\"shop/list_shop_tg.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\"><span>"; ls_return += dt.Rows[i]["cname"].ToString() + "</span></li>"; } } } } #endregion ls_return += "</ul>"; ls_return += "</li>"; } if (JpRoles.ifshowcolumn_sh(Session["uid"].ToString(), "006")) { ls_return += "<li isexpand=\"false\"><span>商城审核</span>"; ls_return += "<ul>"; #region DataTable dt2 = new DataTable(); //文章发布左侧动态产生 //得到一级部门 TPortalClass.JpColumns JpColumns2 = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles2 = new TPortalClass.JpRoles(); string sql_Firstlevcolumns2 = "Select * from JpColumns where len(cid)=6 and cid like '006%' and online=1 order by csort "; dt2 = db.GetDataTable(sql_Firstlevcolumns2); if (dt2.Rows.Count > 0) { for (int i = 0; i < dt2.Rows.Count; i++) { //有下一级部门 string sql_isHaveSubColumn2 = " select * from JpColumns where cid like '" + dt2.Rows[i]["cid"].ToString() + "%' and len(cid) = 9 and online = 1 order by csort "; DataTable dt_isHaveSbuColumn2 = db.GetDataTable(sql_isHaveSubColumn2); bool b_isHaveSbuColumn2; if (dt_isHaveSbuColumn2.Rows.Count > 0) { b_isHaveSbuColumn2 = true; } else { b_isHaveSbuColumn2 = false; } if (b_isHaveSbuColumn2 == true) { string sql_ifshowcolumn2 = " select * from JpRoles a,JpColumns b where a.cid=b.cid and a.role='editor' and a.uid='" + Session["uid"].ToString() + "' and a.cid like '" + dt2.Rows[i]["cid"].ToString() + "%' "; DataTable dt_ifshowcolumn2 = db.GetDataTable(sql_isHaveSubColumn2); bool b_ifshowcolumn2; if (dt_ifshowcolumn2.Rows.Count > 0) { b_ifshowcolumn2 = true; } else { b_ifshowcolumn2 = false; } if (b_ifshowcolumn2 == true) { string sql_ifhaveAuthorRoleBycidanduid2 = " select * from JpRoles where role='editor' and uid='" + Session["uid"].ToString() + "' and cid='" + dt2.Rows[i]["cid"].ToString() + "' "; DataTable dt_ifhaveAuthorRoleBycidanduid2 = db.GetDataTable(sql_isHaveSubColumn2); bool b_ifhaveAuthorRoleBycidanduid2; if (dt_ifhaveAuthorRoleBycidanduid2.Rows.Count > 0) { b_ifhaveAuthorRoleBycidanduid2 = true; } else { b_ifhaveAuthorRoleBycidanduid2 = false; } if (b_ifhaveAuthorRoleBycidanduid2 == true) { ls_return += "<li isexpand=\"false\" url=\"shop/list_shop_sh.aspx?cid=" + dt2.Rows[i]["cid"].ToString() + "\">"; } else { ls_return += "<li isexpand=\"false\">"; } ls_return += "<span>" + dt2.Rows[i]["cname"].ToString() + "</span>"; ls_return += "<ul>"; ls_return += GetShopNextColumn_editor(dt2.Rows[i]["cid"].ToString()); ls_return += "</ul>"; ls_return += "</li>"; } } else { DataTable dt_ifhaveAuthorRoleBycidanduid2 = db.GetDataTable(sql_isHaveSubColumn2); bool b_ifhaveAuthorRoleBycidanduid2; if (dt_ifhaveAuthorRoleBycidanduid2.Rows.Count > 0) { b_ifhaveAuthorRoleBycidanduid2 = true; } else { b_ifhaveAuthorRoleBycidanduid2 = false; } if (b_ifhaveAuthorRoleBycidanduid2 == true) { ls_return += "<li url=\"shop/list_shop_tg.aspx?cid=" + dt2.Rows[i]["cid"].ToString() + "\"><span>"; ls_return += dt2.Rows[i]["cname"].ToString() + "</span></li>"; } } } } #endregion ls_return += "</ul>"; ls_return += "</li>"; } } return ls_return; }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); if (Request.QueryString["uid"] != null) ls_uid = Request.QueryString["uid"].ToString(); if (!this.IsPostBack) { Response.Write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"); Response.Write("<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"zh-cn\">"); Response.Write("<Head><Title>选择栏目</Title>"); Response.Write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">"); Response.Write("<meta name=\"generator\" content=\"editplus\" />"); Response.Write("<link type=\"text/css\" rel=\"stylesheet\" href=\"hyhtml/ltree/resources/css/lTREE.default.css\" />"); Response.Write("<style type=\"text/css\">"); Response.Write("#lTREEMenuDEMO {border:0px solid #ccc;margin:3px;padding:3px;}"); Response.Write("#infoBox {position:absolute;left:450px;top:40px;border:1px solid #ccc;width:400px;padding:0 10px;font-family:\"宋体\",Geneva,Arial,sans-serif;line-height:150%;}"); Response.Write("#debugMSG strong {color:#f00;}"); Response.Write("</style>"); Response.Write("<!--[if IE 6]>"); Response.Write("<script>"); Response.Write("document.execCommand(\"BackgroundImageCache\", false, true);"); Response.Write("</script>"); Response.Write("<![endif]-->"); Response.Write("</Head>"); Response.Write("<body style=\"width: 100%; height:100%;line-height:23px;\">"); //Response.Write("<form>"); Response.Write("<div style=\"font-size:14px; text-align:center;width:80%; border-bottom:1px dashed #cccccc;color: #bbbbbb;\" valign=\"top\"><b>栏目列表</b></div>"); Response.Write("<div class=\"lTREEMenu lTREENormal\" id=\"lTREEMenuDEMO\">"); Response.Write("<dl>"); Response.Write("<dl>"); Response.Write("<dd> <a href=\"../settings/main_columnrole.aspx?cid=&uid=" + ls_uid + "&rnd=" + System.Guid.NewGuid().ToString() + "\" target=\"RightIframeWin\">所有栏目列表</a>"); Response.Write("<dl>"); //得到一级部门 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); DataTable dt = JpColumns.GetFirstlevcolumns_online(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级部门 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { //输出一级部门头部 Response.Write("<dd class=\"folderClose\">"); Response.Write("<a href=\"../settings/main_columnrole.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "&uid=" + ls_uid + "&rnd=" + System.Guid.NewGuid().ToString() + "\" target=\"RightIframeWin\">"); Response.Write(dt.Rows[i]["cname"].ToString()); Response.Write("</a>"); Response.Write("<dl>"); GetNextColumn(dt.Rows[i]["cid"].ToString()); //输出一级部门尾部 Response.Write("</dl>"); Response.Write("</dd>"); } else { Response.Write("<dt>"); Response.Write("<a href=\"../settings/main_columnrole.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "&uid=" + ls_uid + "&rnd=" + System.Guid.NewGuid().ToString() + "\" target=\"RightIframeWin\">"); Response.Write(dt.Rows[i]["cname"].ToString()); Response.Write("</a>"); Response.Write("</dt>"); } } } Response.Write("</dl>"); Response.Write("</dd>"); Response.Write("</dl>"); Response.Write("</div>"); Response.Write("<script type=\"text/javascript\" src=\"hyhtml/ltree/js/lTREE.js\"></script>"); Response.Write("<script class=\"lJSFDemo\" type=\"text/javascript\"> "); Response.Write(" var lTree = new lTREE();"); Response.Write(" lTree.config({"); Response.Write(" path : \"dl dd\""); Response.Write(" });"); Response.Write(" lTree.tagName({"); Response.Write(" folder : \"DD\","); Response.Write(" file : \"DT\""); Response.Write(" });"); Response.Write(" lTree.className({"); Response.Write(" folderClose : \"folderClose\","); Response.Write(" lastChild : \"lastChild\""); Response.Write(" });"); Response.Write("var t=new Date(),timer=[];"); Response.Write("lTree.build(\"lTREEMenuDEMO\");"); Response.Write("timer.push(new Date()-t);"); /************************************** * 给树内所有复选框添加相应事件 * * Start */ Response.Write(" </script>"); //Response.Write("</form>"); Response.Write("</Body></HTML>"); } }
private string GetNextColumn_sh(string pis_cid) { string ls_return = ""; //得到二级部门 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); DataTable dt = JpColumns.GetSubColumnsOrderbysort_online(pis_cid); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级部门 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { if (JpRoles.ifshowcolumn_sh(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { if (JpRoles.ifhaveEditorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true && JpColumns.ifhotpublish(dt.Rows[i]["cid"].ToString()) == false) { ls_return += "<li isexpand=\"false\" url=\"article/list_article_sh.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\">"; } else { ls_return += "<li isexpand=\"false\">"; } ls_return += "<span>" + dt.Rows[i]["cname"].ToString() + "</span>"; ls_return += "<ul>"; ls_return += GetNextColumn_sh(dt.Rows[i]["cid"].ToString()); ls_return += "</ul>"; ls_return += "</li>"; } } else { if (JpRoles.ifhaveEditorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true && JpColumns.ifhotpublish(dt.Rows[i]["cid"].ToString()) == false) { ls_return += "<li url=\"article/list_article_sh.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\"><span>"; ls_return += dt.Rows[i]["cname"].ToString() + "</span></li>"; } } } } return ls_return; }
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 string GetShopNextColumn_editor(string pis_cid) { TPortalClass.DAO db = new TPortalClass.DAO(); string ls_return = ""; //得到二级部门 TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles(); DataTable dt = JpColumns.GetSubColumnsOrderbysort_online(pis_cid); string sql_GetSubColumnsOrderbysort_online = " select * from JpColumns where online=1 and cid like '" + pis_cid + "%' and len(cid)=9 order by csort"; dt = db.GetDataTable(sql_GetSubColumnsOrderbysort_online); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //有下一级部门 if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true) { if (JpRoles.ifshowcolumn_sh(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { if (JpRoles.ifhaveEditorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { ls_return += "<li isexpand=\"false\" url=\"shop/list_shop_sh.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\">"; } else { ls_return += "<li isexpand=\"false\">"; } ls_return += "<span>" + dt.Rows[i]["cname"].ToString() + "</span>"; ls_return += "<ul>"; ls_return += GetShopNextColumn_editor(dt.Rows[i]["cid"].ToString()); ls_return += "</ul>"; ls_return += "</li>"; } } else { if (JpRoles.ifhaveEditorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true) { ls_return += "<li url=\"shop/list_shop_sh.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\"><span>"; ls_return += dt.Rows[i]["cname"].ToString() + "</span></li>"; } } } } return ls_return; }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns(); //先判断静态发布路径是否已经存在 if (this.txtpubhtmlpath.Text.Trim() != "") { if (JpColumns.IsExist_pubhtmlpath(this.txtcid.Text, this.txtpubhtmlpath.Text.Trim()) == true) { ls_tip = "静态发布路径已存在不能重复,请重新填写!"; Response.Write("<script>alert('" + ls_tip + "');</script>"); return; } } JpColumns.cid = this.txtcid.Text; JpColumns.cname = this.txtcname.Text; JpColumns.tmp_col = this.ddltmp_col.SelectedValue; JpColumns.tmp_art = this.ddltmp_art.SelectedValue; JpColumns.seotitle = this.txtseotitle.Text; JpColumns.seokeywords = this.txtseokeywords.Text; JpColumns.seodescription = this.txtseodescription.Text; JpColumns.pubhtmlpath = this.txtpubhtmlpath.Text; JpColumns.csort = System.Int32.Parse(this.txtcsort.Text); JpColumns.rss = System.Int32.Parse(this.txtrss.Text); //JpColumns.newpic = this.txtnewpic.Text; string lsfilename = FileUpload1.FileName; string lspath = "", lsurl = "", str_path = ""; if (lsfilename != "") //attsize { lsfilename = System.Guid.NewGuid() + "_" + lsfilename; //将附件上传到服务器目录下 lspath = Server.MapPath("~/"); //虚拟目录的位置 lsurl = "/upload/columnpic"; //原图存放的文件夹 Directory.CreateDirectory(lspath + "/" + lsurl); str_path = lspath + "/" + lsurl + "/" + lsfilename; FileUpload1.SaveAs(str_path); JpColumns.newpic = lsurl + "/" + lsfilename; } else { JpColumns.newpic = this.txtpicurl.Value; } JpColumns.newday = System.Int32.Parse(this.txtnewday.Text); if (cblsx.Items[0].Selected == true) { JpColumns.online = "1"; } else { JpColumns.online = "0"; } if (cblsx.Items[1].Selected == true) { JpColumns.hotpublish = "1"; } else { JpColumns.hotpublish = "0"; } if (cblsx.Items[2].Selected == true) { JpColumns.shtml = "1"; } else { JpColumns.shtml = "0"; } if (cblsx.Items[3].Selected == true) { JpColumns.pubtime = "1"; } else { JpColumns.pubtime = "0"; } if (this.txtop.Value == "add") { //写系统日志 TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "新增", "新增栏目记录[id:" + this.txtcid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpColumns.Insert(); } else { //写系统日志 TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "修改", "修改栏目记录[id:" + this.txtcid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpColumns.Update(); } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
/// <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; }