//保存 protected void btnSave_Click(object sender, EventArgs e) { if (this.Session["uid"] == null || this.Session["uid"].ToString() == "") { this.Response.Redirect("../login.aspx"); } string ls_tip = "提交成功!"; TPortalClass.DAO db = new TPortalClass.DAO(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); TPortalClass.JpGoods JpGoods = new TPortalClass.JpGoods(); JpGoods.hy_cid =ddlcolname.Value; JpGoods.hy_goodsname = txthy_goodsname.Text; JpGoods.hy_goodstitle = txthy_goodstitle.Text; JpGoods.hy_linkurl = txthy_linkurl.Text; JpGoods.hy_content = txthy_content.Text; JpGoods.hy_goodsprice = Convert.ToDouble(txthy_goodsprice.Text); JpGoods.hy_sort = Convert.ToInt32(txthy_sort.Text); JpGoods.hy_ifsh = 0; JpGoods.docid = this.txtDocid.Value; if (this.txtop.Value == "add") { //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "新增", "新增商品记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpGoods.Insert(); } else { //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "修改", "修改广告链接记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpGoods.id = int.Parse(txtid.Value.Trim()); JpGoods.Update(); } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
//发布 protected void btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"] == null || this.Session["uid"].ToString() == "") { this.Response.Redirect("../login.aspx"); } string ls_tip = "发布成功!"; TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); TPortalClass.JpPhotography JpPhotography = new TPortalClass.JpPhotography(); JpPhotography.id = Convert.ToInt32(txtid.Value); JpPhotography.hy_uid = txthy_uid.Text; JpPhotography.hy_addtime = Convert.ToDateTime(txthy_addtime.Text); JpPhotography.hy_address = txthy_address.Text; JpPhotography.hy_content = txthy_content.Text; JpPhotography.hy_ifsh = 2; JpPhotography.hy_sort = Convert.ToInt32(txthy_sort.Text); JpPhotography.docid = txtDocid.Value; //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "发布", "发布手摄记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpPhotography.Update(); Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
//保存排序 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 btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"] == null || this.Session["uid"].ToString() == "") { this.Response.Redirect("../login.aspx"); } string ls_tip = "审核成功!"; TPortalClass.JpActivity JpActivity = new TPortalClass.JpActivity(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); TPortalClass.DAO db = new TPortalClass.DAO(); string sql_cg = "update hy_activity set hy_ifsh=2 where id=" + System.Int32.Parse(this.txtid.Value) + ""; db.Execute(sql_cg); //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "审核", "审核活动记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpActivity.Update(); Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
//答复 protected void btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"] == null || this.Session["uid"].ToString() == "") { this.Response.Redirect("../login.aspx"); } string ls_tip = "答复成功!"; TPortalClass.DAO db = new TPortalClass.DAO(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); string ls_ = txthy_reply.Text; int ls_hy_ifsh = 2; //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "答复", "答复求助记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); string sql_Update = " UPDATE hy_help SET"; sql_Update += " hy_reply ='" + txthy_reply.Text + "'"; sql_Update += " , hy_replytime ='" + DateTime.Now.ToString("yyyy-MM-dd") + "'"; sql_Update += " , hy_ifsh =" + ls_hy_ifsh + " where id=" + Convert.ToInt32(txtid.Value.Trim()) + ""; db.Execute(sql_Update); Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</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 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 btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); if (this.txtoldpwd.Text == "") { this.Response.Write("<script language=javascript>alert('请输入旧密码!')</script>"); return; } if (this.txtnewpwd.Text == "") { this.Response.Write("<script language=javascript>alert('请输入新密码!')</script>"); return; } if (this.txtcomfig.Text == "") { this.Response.Write("<script language=javascript>alert('请输入确认密码!')</script>"); return; } if (this.txtnewpwd.Text != this.txtcomfig.Text) { this.Response.Write("<script language=javascript>alert('输入的新密码和确认密码不一致!')</script>"); return; } TPortalClass.JpUsers Users = new TPortalClass.JpUsers(); String password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtoldpwd.Text, "MD5"); if (!Users.Login(Session["uid"].ToString(), password)) { this.Response.Write("<script language=javascript>alert('输入旧密码不正确!')</script>"); return; } if (Users.DoChPwd(Session["uid"].ToString(), this.txtnewpwd.Text)) { //写系统日志 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, "修改密码", "修改密码", Session["uid"].ToString(), Session["uname"].ToString()); this.Response.Write("<script language=javascript>alert('修改密码成功!');window.location='main_xgmm.aspx?rnd=" + System.Guid.NewGuid().ToString() + "';</script>"); } else { this.Response.Write("<script language=javascript>alert('修改密码失败!');window.location='main_xgmm.aspx?rnd=" + System.Guid.NewGuid().ToString() + "';</script>"); } }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; //新文档时 TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers(); JpUsers.uid = this.txtuid.Text; JpUsers.uname = this.txtuname.Text; JpUsers.deptid = this.ddldept.SelectedValue; JpUsers.usort = System.Int32.Parse(this.txtusort.Text); JpUsers.createtime = System.DateTime.Now.ToString(); if (this.txtop.Value == "add") { if (JpUsers.IsExist()) { this.Response.Write("<script language=javascript>alert('该人员已经存在!')</script>"); return; } //写系统日志 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.txtuid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpUsers.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.txtuid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpUsers.Update(); } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
//批量删除 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 btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; //新文档时 TPortalClass.JpTemplate JpTemplate = new TPortalClass.JpTemplate(); JpTemplate.tclass = this.txthy_type.SelectedValue; JpTemplate.url = this.txthy_templateurl.Text; JpTemplate.description = this.txthy_template.Text; if (this.txtop.Value == "add") { if(JpTemplate.IsExist()) { this.Response.Write("<script>alert('该模版已经存在!')</script>"); return; } //写系统日志 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.txthy_templateurl.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpTemplate.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.txthy_templateurl.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpTemplate.Update(); } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</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 btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; //新文档时 TPortalClass.JpDepts JpDepts = new TPortalClass.JpDepts(); JpDepts.deptid = this.txtdeptid.Text; JpDepts.deptname = this.txtdeptname.Text; JpDepts.deptsort = System.Int32.Parse(this.txtdeptsort.Text.ToString()); JpDepts.factdeptid = ""; JpDepts.HeadUnit = ""; JpDepts.SubDept = ""; 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.txtdeptid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpDepts.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.txtdeptid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpDepts.Update(); } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; TPortalClass.JpSite JpSite = new TPortalClass.JpSite(); JpSite.SiteName = this.txthy_siteName.Text; JpSite.CompName = this.txthy_compName.Text; JpSite.host = this.txthy_host.Text; JpSite.root = this.txtroot.Text; JpSite.tel = this.txthy_tel.Text; JpSite.fax = this.ddlhtml.SelectedValue; JpSite.adminemail = this.txthy_adminemail.Text; JpSite.bah = this.txthy_bah.Text; JpSite.seo_indextitle = this.txthy_seo_indextitle.Text; JpSite.seo_indexkeyword = this.txthy_seo_indexkeyword.Text; JpSite.seo_indexdescription = this.txthy_seo_indexdescription.Text; JpSite.copyright = this.txthy_copyright.Text; JpSite.homepage = this.txthy_homepage.Text; JpSite.dbname = this.txthy_dbname.Text; JpSite.visitors = System.Int32.Parse(this.txthy_visitors.Text); JpSite.version = this.txthy_version.Text; JpSite.nwyuming = this.txthy_nwyuming.Text; JpSite.wwyuming = this.txthy_wwyuming.Text; JpSite.lan_big5 = this.ddllan_big5.SelectedValue; //写系统日志 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.txthy_siteName.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpSite.Update(); Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; //新文档时 TPortalClass.JpRole JpRole = new TPortalClass.JpRole(); JpRole.hy_roleid = this.txthy_roleid.Text; JpRole.hy_rolename = this.txthy_rolename.Text; JpRole.hy_sort = float.Parse(this.txthy_sort.Text); 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.txthy_roleid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpRole.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.txthy_roleid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpRole.Update(); } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
protected void btnLogin_Click(object sender, EventArgs e) { if (Session["checkcode"].ToString().Equals(this.txt_checkcode.Value)) { String password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txt_password.Value, "MD5"); TPortalClass.JpUsers Users = new TPortalClass.JpUsers(); if (Users.Login(this.txt_username.Value, password)) { TPortalClass.JpUsers userinfo = new TPortalClass.JpUsers(this.txt_username.Value); Session["uid"] = userinfo.uid; Session["uname"] = userinfo.uname; TPortalClass.JpRoles roles = new TPortalClass.JpRoles(); Session["role"] = roles.GetRolesListByUID(userinfo.uid); String aa = Session["role"].ToString(); //写系统日志 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, "登录", "后台登录", Session["uid"].ToString(), Session["uname"].ToString()); this.Response.Redirect(this.lblurl.Text); } else { Response.Write("<script>alert('输入的用户名或者密码不正确!');window.location.href = window.location.href;</script>"); return; } } else { Response.Write("<script>alert('校验码不正确!');window.location.href = window.location.href;</script>"); return; } }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; TPortalClass.JpComment JpComment = new TPortalClass.JpComment(); JpComment.id = System.Int32.Parse(this.txtid.Text); JpComment.ifshow = this.txthy_ifshow.SelectedValue; //写系统日志 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.txtid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpComment.Update_sh(); Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</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>"); }
//批量删除 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>"); }
//保存 protected void btnSave_Click(object sender, EventArgs e) { if (this.Session["uid"] == null || this.Session["uid"].ToString() == "") { this.Response.Redirect("../login.aspx"); } string ls_tip = "保存成功!"; TPortalClass.JpGuidePage JpGuidePage = new TPortalClass.JpGuidePage(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); JpGuidePage.hy_name = this.txthy_name.Text; JpGuidePage.hy_url = this.txthy_url.Text; JpGuidePage.hy_sort = int.Parse(this.txthy_sort.Text); JpGuidePage.hy_ifused = Convert.ToInt32(ddlifused.Value); string lsfilename = FileUpload1.FileName; string lspath = "", lsurl = "", str_path = ""; if (lsfilename != "") //attsize { lsfilename = System.Guid.NewGuid() + "_" + lsfilename; //将附件上传到服务器目录下 lspath = Server.MapPath("~/"); //虚拟目录的位置 lsurl = "/upload/guidepagepic_yt"; //原图存放的文件夹 Directory.CreateDirectory(lspath + "/" + lsurl); str_path = lspath + "/" + lsurl + "/" + lsfilename; FileUpload1.SaveAs(str_path); JpGuidePage.hy_images = lsurl + "/" + lsfilename; } else { JpGuidePage.hy_images = this.txtpicurl.Value; } JpGuidePage.hy_addtime = System.DateTime.Now; if (this.txtop.Value == "add") { //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "新增", "新增引导页记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpGuidePage.Insert(); } else { JpGuidePage.id = System.Int32.Parse(this.txtid.Value); //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "修改", "修改引导页记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpGuidePage.Update(); } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
//保存 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>"); }
//审核 protected void btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"] == null || this.Session["uid"].ToString() == "") { this.Response.Redirect("../login.aspx"); } TPortalClass.JpAdver JpAdver = new TPortalClass.JpAdver(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); JpAdver.hy_advername = this.txthy_advername.Text; JpAdver.hy_way = this.txthy_way.SelectedValue; JpAdver.hy_adverurl = this.txthy_adverurl.Text; JpAdver.hy_sort = int.Parse(this.txthy_sort.Text); JpAdver.hy_adversize = this.txthy_adversize.Text; JpAdver.hy_advertitle = this.txthy_advertitle.Text; JpAdver.hy_used = "0"; JpAdver.hy_ifsh = 2; JpAdver.hy_starttime = this.txthy_starttime.Value.Trim(); JpAdver.hy_endtime = this.txthy_endtime.Value.Trim(); TPortalClass.DAO db = new TPortalClass.DAO(); string lsfilename = FileUpload1.FileName; string lspath = "", lsurl = "", str_path = ""; if (lsfilename != "") //attsize { lsfilename = System.Guid.NewGuid() + "_" + lsfilename; //将附件上传到服务器目录下 lspath = Server.MapPath("~/"); //虚拟目录的位置 lsurl = "/upload/adverpic_yt"; //原图存放的文件夹 Directory.CreateDirectory(lspath + "/" + lsurl); str_path = lspath + "/" + lsurl + "/" + lsfilename; FileUpload1.SaveAs(str_path); JpAdver.hy_adverpic = lsurl + "/" + lsfilename; } else { JpAdver.hy_adverpic = this.txtpicurl.Value; } string ls_tip = "发布成功!"; if (this.txtop.Value == "add") { if (JpAdver.IsExist()) { this.Response.Write("<script language=javascript>alert('该广告名称已经存在!')</script>"); return; } //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "广告审核", "广告审核记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpAdver.Insert(); } else { JpAdver.id = System.Int32.Parse(this.txtid.Value); //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "广告审核", "广告审核记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpAdver.Update(); } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
//发布 protected void btnFB_Click(object sender, EventArgs e) { if (this.Session["uid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "发布成功!"; //新文档时 TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); JpArticle.cid = this.txtcid.Text; JpArticle.title = this.txttitle.Text; JpArticle.subhead = this.txttitle2.Text; JpArticle.ht_content = this.content1.Value; if (this.txtsummary.Text == "") { JpArticle.summary = JpCommon.OutPicGetStr(this.content1.Value, 150); } else { JpArticle.summary = this.txtsummary.Text; } JpArticle.author = this.Session["uname"].ToString(); JpArticle.status = "发布"; //JpArticle.ifindexdisplay = ""; string lsfilename = FileUpload1.FileName; string lspath = ""; string lsurl = ""; string str_path = ""; if (lsfilename != "") //attsize { //SaveCommon(ls_path, ls_attsize, lsguid); //将附件上传到服务器目录下 lspath = Server.MapPath("~/");//虚拟目录的位置 lsurl = "/upload/indexpic"; //存放的文件夹 Directory.CreateDirectory(lspath + "/" + lsurl); str_path = lspath + "/" + lsurl + "/" + lsfilename; FileUpload1.SaveAs(str_path); JpArticle.indexdisplaypicpath = lsurl + "/" + lsfilename; } else { this.txtpic.Value = JpCommon.GetImg(this.content1.Value); JpArticle.indexdisplaypicpath = this.txtpic.Value; } if (this.txtseotitle.Text == "") { JpArticle.seotitle = this.txttitle.Text; } else { JpArticle.seotitle = this.txtseotitle.Text; } if (this.txtseokeywords.Text == "") { JpArticle.seokeywords = this.txttitle.Text; } else { JpArticle.seokeywords = this.txtseokeywords.Text; } if (this.txtseodescription.Text == "") { JpArticle.seodescription = JpCommon.OutPicGetStr(this.content1.Value, 150); } else { JpArticle.seodescription = this.txtseodescription.Text; } JpArticle.asort = System.Int32.Parse(this.txtasort.Text); JpArticle.iftop = this.ddlsfzd.SelectedValue; JpArticle.topendtime = this.txttopendtime.Value; JpArticle.ifindexdisplay = this.ddlsfsyss.SelectedValue; JpArticle.ifcomment = "0"; JpArticle.source = this.txtsource.Value; JpArticle.role_userid = this.txtrole_userid.Text; JpArticle.role_username = this.txtrole_username.Text; JpArticle.input = this.Session["uid"].ToString(); JpArticle.GUID = this.txtguid.Text; if (ddllb.SelectedValue != "请选择") { JpArticle.map_cid = ddllb.SelectedValue; } else { JpArticle.map_cid = ""; } JpArticle.map_aid = 0; JpArticle.targettype = ""; JpArticle.hits = 0; JpArticle.goodnum = 0; if (radlist.SelectedValue == "否") { JpArticle.sfzwd = radlist.SelectedValue; JpArticle.zwdid = ddlwz.SelectedValue; } else { JpArticle.sfzwd = radlist.SelectedValue; JpArticle.zwdid = ""; } if (this.txtendtime.Text != "") { JpArticle.endtime = this.txtendtime.Text; } else { JpArticle.endtime = System.DateTime.Now.AddYears(10).ToString(); } if (this.txtpubtime.Text != "") { JpArticle.pubtime = this.txtpubtime.Text; } else { JpArticle.pubtime = System.DateTime.Now.ToString(); } if (this.txtop.Value == "add") { //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "审核新增", "审核新增文章记录[guid:" + this.txtguid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpArticle.Insert(); } else { //写系统日志 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()); JpArticle.aid = System.Int32.Parse(this.txtaid.Text); JpArticle.Update(); } //静态发布 TPortalClass.JpSite JpSite = new TPortalClass.JpSite(); string ls_html = JpSite.fax; if (ls_html == "开启") { DataTable dt = JpArticle.GetArticleByGUID(this.txtguid.Text); if (dt.Rows.Count > 0) { JpArticle.PubAll("," + dt.Rows[0]["aid"].ToString() + ",", this.txtpubtime.Text, this.txtendtime.Text); } } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</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 btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"] == null || this.Session["uid"].ToString() == "") { this.Response.Redirect("../login.aspx"); } string ls_tip = "保存成功!"; TPortalClass.JpActivityusers JpActivityusers = new TPortalClass.JpActivityusers(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); JpActivityusers.hy_name = txthy_name.Text.Trim(); JpActivityusers.hy_tel = txthy_tel.Text.Trim(); JpActivityusers.hy_addtime = txthy_addtime.Text.Trim(); JpActivityusers.hy_id = Convert.ToInt32(ddlhy_id.SelectedValue); JpActivityusers.hy_pwd = ""; JpActivityusers.hy_nc = ""; JpActivityusers.hy_mail = ""; JpActivityusers.hy_sex = ""; JpActivityusers.hy_addr = ""; JpActivityusers.hy_txzp = ""; JpActivityusers.hy_islock = ""; JpActivityusers.hy_ismailyz = ""; JpActivityusers.hy_issmrz = ""; JpActivityusers.hy_sfzpic = ""; JpActivityusers.hy_sfzcard = ""; JpActivityusers.hy_company = ""; JpActivityusers.hy_position = ""; JpActivityusers.hy_post = ""; JpActivityusers.hy_key = ""; JpActivityusers.hy_type = ""; JpActivityusers.hy_logo = ""; JpActivityusers.hy_sfxs = ""; JpActivityusers.hy_lev = ""; JpActivityusers.hy_pic = ""; JpActivityusers.hy_ifsh = 0; JpActivityusers.hy_sort = 1; if (this.txtop.Value == "add") { //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "新增", "新增广告链接记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpActivityusers.Insert(); } else { JpActivityusers.id = System.Int32.Parse(this.txtid.Value); //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "修改", "修改广告链接记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpActivityusers.Update(); } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</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>"); }
//全部复制 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 btnSubmit_Click(object sender, EventArgs e) { if (this.Session["uid"] == null || this.Session["uid"].ToString() == "") { this.Response.Redirect("../login.aspx"); } string ls_tip = "保存成功!"; TPortalClass.JpActivity JpActivity = new TPortalClass.JpActivity(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); JpActivity.hy_bt = this.txthy_bt.Text; JpActivity.hy_content = this.txthy_content.Text; JpActivity.hy_address = this.txthy_address.Text; JpActivity.hy_tel = this.txthy_tel.Text; JpActivity.hy_starttime = this.txthy_starttime.Value; JpActivity.hy_endtime = this.txthy_endtime.Value; JpActivity.hy_contact = this.txthy_contact.Text; JpActivity.hy_category = this.txthy_category.Text; JpActivity.hy_bz = this.txthy_bz.Text; JpActivity.hy_sort = Convert.ToInt32(this.txthy_sort.Text); JpActivity.hy_addtime = DateTime.Now.ToString(); JpActivity.hy_djr = this.txtdjr.Value; JpActivity.hy_ifsh = 1; JpActivity.docid = txtDocid.Value; if (this.txtop.Value == "add") { if (JpActivity.IsExist()) { this.Response.Write("<script language=javascript>alert('该活动名已经存在!')</script>"); return; } //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "新增", "新增活动记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpActivity.Insert(); } else { JpActivity.id = System.Int32.Parse(this.txtid.Value); //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "修改", "修改活动记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpActivity.Update(); } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
//全部转移 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 btnSave_Click(object sender, EventArgs e) { if (this.Session["uid"] == null || this.Session["uid"].ToString() == "") { this.Response.Redirect("../login.aspx"); } string ls_tip = "保存成功!"; TPortalClass.JpActivity JpActivity = new TPortalClass.JpActivity(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); JpActivity.hy_bt = this.txthy_bt.Text; JpActivity.hy_content = this.txthy_content.Text; JpActivity.hy_address = this.txthy_address.Text; JpActivity.hy_tel = this.txthy_tel.Text; JpActivity.hy_starttime = this.txthy_starttime.Value; JpActivity.hy_endtime = this.txthy_endtime.Value; JpActivity.hy_contact = this.txthy_contact.Text; JpActivity.hy_category = this.txthy_category.Text; JpActivity.hy_bz = this.txthy_bz.Text; JpActivity.hy_sort = Convert.ToInt32(this.txthy_sort.Text); JpActivity.hy_addtime = this.txtaddtime.Value; JpActivity.hy_djr = this.txtdjr.Value; JpActivity.hy_ifsh = 0; JpActivity.docid = txtDocid.Value; //string lsfilename = FileUpload1.FileName; //string lspath = "", lsurl = "", str_path = ""; //if (lsfilename != "") //attsize //{ // lsfilename = System.Guid.NewGuid() + "_" + lsfilename; // //将附件上传到服务器目录下 // lspath = Server.MapPath("~/"); //虚拟目录的位置 // lsurl = "/upload/activitypic_yt"; //原图存放的文件夹 // Directory.CreateDirectory(lspath + "/" + lsurl); // str_path = lspath + "/" + lsurl + "/" + lsfilename; // FileUpload1.SaveAs(str_path); // JpActivity.hy_images = lsurl + "/" + lsfilename; //} //else //{ // JpActivity.hy_images = this.txtpicurl.Value; //} if (this.txtop.Value == "add") { if (JpActivity.IsExist()) { this.Response.Write("<script language=javascript>alert('该活动名已经存在!')</script>"); return; } //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "新增", "新增活动记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpActivity.Insert(); } else { JpActivity.id = System.Int32.Parse(this.txtid.Value); //写系统日志 string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } JpCommon.WriteLog(userip, "修改", "修改活动记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString()); JpActivity.Update(); } Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }