//保存排序 protected void btnSave_Click(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); TPortalClass.JpRole JpRole = new TPortalClass.JpRole(); 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; float sortId; if (!float.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } JpRole.Updatesort(id, sortId); } string pageUrl = JpCommon.CombUrlTxt("list_role.aspx", "page={0}&rnd={1}", "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + ""); //写系统日志 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>"); }
//删除 protected void btnDelete_Click(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); TPortalClass.JpActivity JpActivity = new TPortalClass.JpActivity(); string ls_tip = "删除成功!"; for (int i = 0; i < rptList.Items.Count; i++) { string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value; CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { JpActivity.id = int.Parse(id); JpActivity.Delete(); } } string pageUrl = JpCommon.CombUrlTxt("list_activity_sh.aspx", "page={0}&rnd={1}", "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + ""); //写系统日志 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 btnGoto_Click(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string pageUrl = JpCommon.CombUrlTxt("list_activity_sh.aspx", "page={0}&rnd={1}&cid={2}", this.txtGotoPage.Text, "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + ""); Response.Redirect(pageUrl); }
//关健字查询 protected void btnSearch_Click(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string pageUrl = JpCommon.CombUrlTxt("list_comment_ysh.aspx", "rnd={0}&keywords={1}", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + ""); Response.Redirect(pageUrl); }
//受理 protected void btnDeal_Click(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); TPortalClass.JpAdver JpAdver = new TPortalClass.JpAdver(); string ls_tip = "受理成功!"; for (int i = 0; i < rptList.Items.Count; i++) { string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value; CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { TPortalClass.DAO db = new DAO(); string sql = "update hy_help set hy_ifsh=1 where id=" + int.Parse(id) + ""; db.Execute(sql); } } string pageUrl = JpCommon.CombUrlTxt("list_help_sh.aspx", "page={0}&rnd={1}", "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + ""); //写系统日志 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 btnSearch_Click(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string pageUrl; TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser(); pageUrl = JpCommon.CombUrlTxt("list_article_tg.aspx", "rnd={0}&keywords={1}&cid={2}&input={3}", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + this.txtcid.Text + "", "" + this.Session["uid"].ToString() + ""); Response.Redirect(pageUrl); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); TPortalClass.JpDepts JpDepts = new TPortalClass.JpDepts(); TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers(); 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 = JpDepts.GetSubDepts(id); if (dt_sub.Rows.Count > 0) { ls_tip = "有下一级组织的信息无法删除,请先删除下一级信息!"; } else { //判断部门下边是否存在人员,存在人员也不能删除! DataTable dt_user = JpUsers.GetUsersBydeptid(id); if (dt_user.Rows.Count > 0) { ls_tip = "该组织下还存在用户,无法进行删除!"; } else { JpDepts.deptid = id; JpDepts.Delete(); } } } } string pageUrl = JpCommon.CombUrlTxt("list_bmxx.aspx", "page={0}&rnd={1}", "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + ""); //写系统日志 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 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>"); }
//初始化密码 protected void btnpwd_Click(object sender, EventArgs e) { TPortalClass.JpUsers users = new TPortalClass.JpUsers(); users.ResetPwd(this.txtuid.Text); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string pageUrl = JpCommon.CombUrlTxt("list_user.aspx", "page={0}&rnd={1}&keywords={2}&deptid={3}", "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + this.ddldept.SelectedValue + ""); //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "初始化密码", "初始化密码[用户ID:" + this.txtuid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); Response.Write("<script>alert('初始化密码成功!');window.location='" + pageUrl + "';</script>"); }
//批量转移 protected void btnplzy_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; string ls_ids = ""; 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_ids == "") { ls_ids = id.ToString(); } else { ls_ids = ls_ids + "," + id.ToString(); } string ls_cids = this.txtcheckcid.Text; string[] lv_cids = ls_cids.Split('+'); for (int j = 0; j < lv_cids.Length; j++) { if (lv_cids[j] != "") { JpArticle.aid = id; JpArticle.cid = lv_cids[j]; JpArticle.UpdatePlzylm(); } } } } 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 + ""); if (ls_ids != "") { string ls_pubtime = System.DateTime.Now.ToString(); string ls_endtime = System.DateTime.Now.AddYears(10).ToString(); if (ls_html == "开启") { JpArticle.PubAll("," + ls_ids + ",", ls_pubtime, ls_endtime); } //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "转移", "批量转移文章ID:" + ls_ids, Session["uid"].ToString(), Session["uname"].ToString()); } else { ls_tip = "批量转移失败!请选中复制源文章和选择一个目标栏目。"; } 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; 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 RptBind() { if (this.Request.QueryString["page"] != null) this.page = int.Parse(this.Request.QueryString["page"].ToString()); else this.page = 1; this.txtKeywords.Text = this.keywords; txtPageNum.Text = this.pageSize.ToString(); txtPage.Text = this.page.ToString(); TPortalClass.JpHelp JpHelp = new TPortalClass.JpHelp(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string ls_key = JpCommon.Filter(this.txtKeywords.Text.Trim()); DataTable dt = new DataTable(); string ls_where = " and hy_content like '%" + ls_key + "%' "; dt = JpHelp.SearchdocsByKey(ls_where, " order by hy_ifsh ", Convert.ToInt32(txtPage.Text), 10); this.totalCount = JpHelp.SearchdocsByKeyNum(ls_where); rptList.DataSource = dt; rptList.DataBind(); string pageUrl = JpCommon.CombUrlTxt("list_help_sh.aspx", "page={0}&rnd={1}&keywords={2}", "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + ""); PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//筛选部门 protected void ddlcolname_SelectedIndexChanged(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string pageUrl = JpCommon.CombUrlTxt("list_article_tg.aspx", "rnd={0}&keywords={1}&cid={2}", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + this.txtcid.Text + ""); Response.Redirect(pageUrl); }
//保存 protected void btnSave_Click(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); string uid = txtuid.Text; TPortalClass.JpRoles Roles = new TPortalClass.JpRoles(); string cidlist = this.txtcids.Text; string[] cids = cidlist.Split(','); string authlist = this.txtauths.Text; string[] auths = authlist.Split(','); string editlist = this.txtedits.Text; string[] edits = editlist.Split(','); int rowcnt = 0; foreach (string cid in cids) { //版主 if (edits[rowcnt] == "1") { Roles.role = "editor"; Roles.uid = uid; Roles.cid = cid; Roles.Delete(); Roles.Insert(); } else { Roles.role = "editor"; Roles.uid = uid; Roles.cid = cid; Roles.Delete(); } //作者 if (auths[rowcnt] == "1") { Roles.role = "author"; Roles.uid = uid; Roles.cid = cid; Roles.Delete(); Roles.Insert(); } else { Roles.role = "author"; Roles.uid = uid; Roles.cid = cid; Roles.Delete(); } rowcnt = rowcnt + 1; } TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string pageUrl = JpCommon.CombUrlTxt("main_columnrole.aspx", "page={0}&rnd={1}&cid={2}&uid={3}", "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", this.txtcid.Text, this.txtuid.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 RptBind() { if (this.Request.QueryString["page"] != null) this.page = int.Parse(this.Request.QueryString["page"].ToString()); else this.page = 1; this.txtKeywords.Text = this.keywords; //this.ddlcolname.SelectedValue = this.deptid; txtPageNum.Text = this.pageSize.ToString(); txtPage.Text = this.page.ToString(); TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle(); DataTable dt; TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser(); dt = JpArticle.GetArticlesBycidAnduidAndtitle_tg(this.txtcid.Text, this.Session["uid"].ToString(), txtKeywords.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(); //TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser(); string pageUrl; pageUrl = JpCommon.CombUrlTxt("list_article_tg.aspx", "page={0}&rnd={1}&keywords={2}&cid={3}&input={4}", "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + this.txtcid.Text + "", "" + this.Session["uid"].ToString() + ""); PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//批量删除 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; this.txtKeywords.Text = this.keywords; txtPageNum.Text = this.pageSize.ToString(); txtPage.Text = this.page.ToString(); TPortalClass.JpComment JpComment = new TPortalClass.JpComment(); DataTable dt = JpComment.Getdocs_ysh(); 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_comment_ysh.aspx", "page={0}&rnd={1}&keywords={2}", "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + ""); PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void RptBind() { if (this.Request.QueryString["page"] != null) this.page = int.Parse(this.Request.QueryString["page"].ToString()); else this.page = 1; this.txtKeywords.Text = this.keywords; txtPageNum.Text = this.pageSize.ToString(); txtPage.Text = this.page.ToString(); TPortalClass.JpActivityusers JpActivityusers = new TPortalClass.JpActivityusers(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string ls_key = JpCommon.Filter(this.txtKeywords.Text.Trim()); DataTable dt = new DataTable(); string sql = ""; sql = " Select top 10 a.hy_bt,b.hy_name,b.hy_tel,b.hy_addtime,b.hy_ifsh,b.hy_id,b.id from hy_activity a,hy_activityusers b "; sql += " where 1=1 and b.hy_id=a.id and a.hy_bt like '%" + ls_key + "%' and a.id not in(select top 0 a.id "; sql += " from hy_activity a,hy_activityusers b where 1=1 and hy_bt like '%" + ls_key + "%' order by a.hy_sort desc,b.hy_sort desc ) "; sql += " order by a.hy_sort desc,b.hy_sort desc"; TPortalClass.DAO db = new TPortalClass.DAO(); dt = db.GetDataTable(sql); string sql_count = "Select count(*) as num from hy_activity a,hy_activityusers b"; sql_count += " where 1=1 and b.hy_id=a.id and a.hy_bt like '%" + ls_key + "%' "; DataTable dt_count = db.GetDataTable(sql_count); if (dt_count.Rows.Count > 0) { this.totalCount = Convert.ToInt32(dt_count.Rows[0]["num"].ToString()); } else { this.totalCount = 0; } rptList.DataSource = dt; rptList.DataBind(); string pageUrl = JpCommon.CombUrlTxt("list_activityusers.aspx", "page={0}&rnd={1}&keywords={2}", "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + ""); PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//全部转移 protected void btnallzy_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; string ls_ids = ""; //根据栏目ID得到该栏目下所有文章 DataTable dt = JpArticle.GetArticlesByCid_fb(this.txtcid.Text); for (int i = 0; i < dt.Rows.Count; i++) { int id = (int)dt.Rows[i]["aid"]; if (ls_ids == "") { ls_ids = id.ToString(); } else { ls_ids = ls_ids + "," + id.ToString(); } string ls_cids = this.txtcheckcid.Text; string[] lv_cids = ls_cids.Split('+'); for (int j = 0; j < lv_cids.Length; j++) { if (lv_cids[j] != "") { JpArticle.aid = id; JpArticle.cid = lv_cids[j]; JpArticle.UpdatePlzylm(); } } } 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 + ""); if (ls_ids != "") { string ls_pubtime = System.DateTime.Now.ToString(); string ls_endtime = System.DateTime.Now.AddYears(10).ToString(); if (ls_html == "开启") { JpArticle.PubAll("," + ls_ids + ",", ls_pubtime, ls_endtime); } //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "全部转移", "将栏目ID:" + this.txtcid.Text + "全部转移到栏目ID:" + this.txtcheckcid.Text, Session["uid"].ToString(), Session["uname"].ToString()); } else { ls_tip = "全部转移失败!请选中复制源栏目和选择一个目标栏目。"; } Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>"); }
//发布 protected void btnpubart_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.PubAll("," + id + ",", this.txtpubtime.Value, this.txtendtime.Value); //静态发布时使用 } else { JpArticle.PubAllNoHtml("," + id + ",", this.txtpubtime.Value, this.txtendtime.Value);//非静态发布时使用 } } } 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 btnSearch_Click(object sender, EventArgs e) { TPortalClass.JpCommon HyCommon = new TPortalClass.JpCommon(); string pageUrl = HyCommon.CombUrlTxt("list_shop_tg.aspx", "page={0}&rnd={1}&keywords={2}&cid={3}", "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + txtcid.Value + ""); Response.Redirect(pageUrl); }
//全部复制 protected void btnallfz_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; string ls_ids = ""; //根据栏目ID得到该栏目下所有文章 DataTable dt = JpArticle.GetArticlesByCid_fb(this.txtcid.Text); for (int i = 0; i < dt.Rows.Count; i++) { int id = (int)dt.Rows[i]["aid"]; string ls_cids = this.txtcheckcid.Text; string[] lv_cids = ls_cids.Split('+'); for (int j = 0; j < lv_cids.Length; j++) { if (lv_cids[j] != "") { JpArticle.cid = lv_cids[j]; JpArticle.title = dt.Rows[i]["title"].ToString(); JpArticle.subhead = dt.Rows[i]["subhead"].ToString(); JpArticle.ht_content = dt.Rows[i]["ht_content"].ToString(); JpArticle.summary = dt.Rows[i]["summary"].ToString(); JpArticle.author = dt.Rows[i]["author"].ToString(); JpArticle.status = dt.Rows[i]["status"].ToString(); JpArticle.indexdisplaypicpath = dt.Rows[i]["indexdisplaypicpath"].ToString(); JpArticle.seotitle = dt.Rows[i]["seotitle"].ToString(); JpArticle.seokeywords = dt.Rows[i]["seokeywords"].ToString(); JpArticle.seodescription = dt.Rows[i]["seodescription"].ToString(); JpArticle.asort = (int)dt.Rows[i]["asort"]; JpArticle.iftop = dt.Rows[i]["iftop"].ToString(); JpArticle.topendtime = dt.Rows[i]["topendtime"].ToString(); JpArticle.ifindexdisplay = dt.Rows[i]["ifindexdisplay"].ToString(); JpArticle.ifcomment = dt.Rows[i]["ifcomment"].ToString(); JpArticle.source = dt.Rows[i]["source"].ToString(); JpArticle.role_userid = dt.Rows[i]["role_userid"].ToString(); JpArticle.role_username = dt.Rows[i]["role_username"].ToString(); JpArticle.input = dt.Rows[i]["input"].ToString(); JpArticle.GUID = System.Guid.NewGuid().ToString(); JpArticle.map_cid = dt.Rows[i]["map_cid"].ToString(); JpArticle.map_aid = (int)dt.Rows[i]["map_aid"]; JpArticle.targettype = dt.Rows[i]["targettype"].ToString(); JpArticle.endtime = dt.Rows[i]["endtime"].ToString(); JpArticle.pubtime = dt.Rows[i]["pubtime"].ToString(); int ls_newaid = JpArticle.Insert(); if (ls_ids == "") { ls_ids = ls_newaid.ToString(); } else { ls_ids = ls_ids + "," + ls_newaid.ToString(); } } } } 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 + ""); if (ls_ids != "") { //静态发布时使用 string ls_pubtime = System.DateTime.Now.ToString(); string ls_endtime = System.DateTime.Now.AddYears(10).ToString(); if (ls_html == "开启") { JpArticle.PubAll("," + ls_ids + ",", ls_pubtime, ls_endtime); } //写系统日志 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()); } else { ls_tip = "全部复制失败!请选中复制源栏目和选择目标栏目。"; } Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>"); }
//批量复制 protected void btnplfz_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; string ls_ids = ""; for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); if (ls_ids == "") { ls_ids = id.ToString(); } else { ls_ids = ls_ids + "," + id.ToString(); } //string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value; CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { TPortalClass.JpArticle article = new TPortalClass.JpArticle(id); string ls_cids = this.txtcheckcid.Text; string[] lv_cids = ls_cids.Split('+'); for (int j = 0; j < lv_cids.Length; j++) { if (lv_cids[j] != "") { JpArticle.cid = lv_cids[j]; JpArticle.title = article.title; JpArticle.subhead = article.subhead; JpArticle.ht_content = article.ht_content; JpArticle.summary = article.summary; JpArticle.author = article.author; JpArticle.status = article.status; JpArticle.indexdisplaypicpath = article.indexdisplaypicpath; JpArticle.seotitle = article.seotitle; JpArticle.seokeywords = article.seokeywords; JpArticle.seodescription = article.seodescription; JpArticle.asort = article.asort; JpArticle.iftop = article.iftop; JpArticle.topendtime = article.topendtime; JpArticle.ifindexdisplay = article.ifindexdisplay; JpArticle.ifcomment = article.ifcomment; JpArticle.source = article.source; JpArticle.role_userid = article.role_userid; JpArticle.role_username = article.role_username; JpArticle.input = article.input; JpArticle.GUID = System.Guid.NewGuid().ToString(); JpArticle.map_cid = article.map_cid; JpArticle.map_aid = article.map_aid; JpArticle.targettype = article.targettype; JpArticle.endtime = article.endtime; JpArticle.pubtime = article.pubtime; int ls_newaid = JpArticle.Insert(); if (ls_ids == "") { ls_ids = ls_newaid.ToString(); } else { ls_ids = ls_ids + "," + ls_newaid.ToString(); } } } } } 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 + ""); if (ls_ids != "") { //静态发布时使用 string ls_pubtime = System.DateTime.Now.ToString(); string ls_endtime = System.DateTime.Now.AddYears(10).ToString(); if (ls_html == "开启") { JpArticle.PubAll("," + ls_ids + ",", ls_pubtime, ls_endtime); } //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "复制", "批量复制文章ID:" + ls_ids, Session["uid"].ToString(), Session["uname"].ToString()); } else { ls_tip = "批量复制失败!请选中复制源文章和选择目标栏目。"; } Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>"); }