//批量撤稿 protected void btncg_Click(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle(); string ls_tip = "撤稿成功!"; TPortalClass.JpSite JpSite = new TPortalClass.JpSite(); string ls_html = JpSite.fax; 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) { if (ls_html == "开启") { JpArticle.TakeoutAll("," + id + ","); //静态发布时使用 } else { JpArticle.TakeoutAllNoHtml("," + id + ","); //非静态发布时使用 } } } string pageUrl = ""; pageUrl = JpCommon.CombUrlTxt("list_article_fb.aspx", "page={0}&rnd={1}&cid={2}", "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid.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>"); }
//撤稿 protected void btnCG_Click(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "撤稿成功!"; //新文档时 TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle(); if (this.txtop.Value == "add") { //新文档不能撤稿 this.Response.Write("<script>alert('新文档不能进行撤稿');</script>"); return; } 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.txtguid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); TPortalClass.JpSite JpSite = new TPortalClass.JpSite(); string ls_html = JpSite.fax; if (ls_html == "开启") { JpArticle.TakeoutAll("," + this.txtaid.Text + ","); //静态发布时使用 } else { JpArticle.TakeoutAllNoHtml("," + this.txtaid.Text + ","); //非静态发布时使用 } } //变化了栏目ID,返回路径也要变掉 if (this.ddlcolname.SelectedValue != this.txtcid_url.Text) { this.txturl.Value = this.txturl.Value.Replace(this.txtcid_url.Text, this.ddlcolname.SelectedValue); } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }