private void RptBind() { TPortalClass.JpCommon JpCommon2 = new TPortalClass.JpCommon(); if (this.Request.QueryString["cid"] != null) this.pis_cid = JpCommon2.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9); TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle(); string ls_where = " and cid like '" + pis_cid + "%' "; string ls_order = " order by pubtime desc"; DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, 1, 3); DataTable tempTable = dt.Clone(); //在现有的DatatTable增加一列 DataColumn col = new DataColumn("showTime", typeof(String)); //将列添加到DataTable中去 tempTable.Columns.Add(col); //循环 对DataTable重新赋值 for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[tempTable.Columns[j].ColumnName] = dt.Rows[i][j]; } //获得间隔的时间 dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["crtime"].ToString())); tempTable.Rows.Add(dr); } rptList.DataSource = tempTable; rptList.DataBind(); this.pis_totalCount = JpArticle.SearchdocsByKeyNum(ls_where); }
//关健字查询 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 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.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 btnAudit_Click(object sender, EventArgs e) { TPortalClass.DAO db = new TPortalClass.DAO(); TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); TPortalClass.JpActivityusers JpActivityusers = new TPortalClass.JpActivityusers(); 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) { string sql = "update hy_activityusers set hy_ifsh=1 where id=" + System.Int32.Parse(id) + ""; db.Execute(sql); } } string pageUrl = ""; pageUrl = JpCommon.CombUrlTxt("list_activityusers.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>"); }
public string RptBind() { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); StringBuilder stringBuilder = new StringBuilder(); TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle(); string ls_where = " and cid like '" + pis_cid + "%' and sfzwd='否' "; string ls_order = " order by pubtime desc"; DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, 1, 6); int commentCount = 0; JpComment jpComment = new JpComment(); for (int i = 0; i < dt.Rows.Count; i++) { commentCount = jpComment.GetdocsbyaidAllCount(dt.Rows[i]["aid"].ToString(), pis_cid); stringBuilder.Append("<li><a onclick=\"locationDetail('art_detail.aspx?aid=" + dt.Rows[i]["aid"].ToString() + "&cid=" + pis_cid + "','" + locationType + "','1')\">"); stringBuilder.Append("<img class=\"scrollLoading\" src=\"" + dt.Rows[i]["indexdisplaypicpath"].ToString() + "\"><h1>"); stringBuilder.Append("" + dt.Rows[i]["title"].ToString() + "</h1>"); stringBuilder.Append("<p class=\"fleft\">" + JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["crtime"].ToString())) + "</p><p class=\"fleft\"><span><i class=\"ico-dj\"></i>" + dt.Rows[i]["praiseCount"].ToString() + "</span></p><p class=\"fleft\"><span><i class=\"ico-pl\"></i>" + commentCount + "</span>"); if (dt.Rows[i]["map_cid"].ToString() != "") { stringBuilder.Append("<p class=\"fright\"><i class=\"ico-zt\">" + dt.Rows[i]["map_cid"].ToString() + "</i></p>"); } stringBuilder.Append("</a></li>"); } return stringBuilder.ToString(); }
protected void Page_Load(object sender, EventArgs e) { string ls_flag = ""; //0登陆成功;1退出系统 string ls_uid = ""; TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); if (this.Request.QueryString["flag"] != null) { ls_flag = this.Request.QueryString["flag"].ToString(); } if (ls_flag == "0") { if (this.Request.QueryString["uid"] != null) { Session["hyuid"] = this.Request.QueryString["uid"].ToString(); } else { Session["hyuid"] = ""; } } else { //退出系统 Session["hyuid"] = ""; } Response.Write(Session["hyuid"].ToString()); }
//发布 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 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 Page_Load(object sender, EventArgs e) { string ls_aid = "", ls_cid = "", strType = "", ls_page = "1", la_pagesize = "10"; TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); //获取参数 if (this.Request.QueryString["type"] != null) { strType = this.Request.QueryString["type"].ToString(); } if (this.Request.QueryString["page"] != null) { ls_page = this.Request.QueryString["page"].ToString(); } if (this.Request.QueryString["cid"] != null) { ls_cid = this.Request.QueryString["cid"].ToString(); } if (this.Request.QueryString["pagesize"] != null) { la_pagesize = this.Request.QueryString["pagesize"].ToString(); } JpArticle JpArticle = new JpArticle(); string ls_where = " and cid = '" + ls_cid + "' "; string ls_order = " order by pubtime desc"; string test = ""; DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, int.Parse(ls_page), int.Parse(la_pagesize)); //转换成json格式 string strJson = JsonConvert.SerializeObject(dt); //数据抛出 Response.Write(strJson); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); TPortalClass.JpHelp JpHelp = new TPortalClass.JpHelp(); 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) { JpHelp.id = int.Parse(id); JpHelp.Delete(); } } 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 btndelinfo_Click(object sender, EventArgs e) { string ls_filepath1 = "", ls_filepath2 = ""; TPortalClass.HyFileatt HyFileatt = new TPortalClass.HyFileatt(); DataTable dt = HyFileatt.Getdocbyid(this.txtuids.Value); if (dt.Rows.Count > 0) { if (dt.Rows[0]["hy_fm"].ToString() == "1") { Response.Write("<script>alert('封面图片不能删除');window.location.href=window.location.href;</script>"); return; } //删除文件夹里的图片 ls_filepath1 = Server.MapPath("~/") + dt.Rows[0]["hy_filepath"].ToString(); ls_filepath2 = Server.MapPath("~/") + dt.Rows[0]["hy_filepath"].ToString().Replace("thumbnail", "original"); if (System.IO.File.Exists(ls_filepath1)) { System.IO.File.Delete(ls_filepath1); } if (System.IO.File.Exists(ls_filepath2)) { System.IO.File.Delete(ls_filepath2); } } //删除数据库记录 HyFileatt.Delete(this.txtuids.Value); //操作日志 TPortalClass.JpCommon HyCommon = new TPortalClass.JpCommon(); // HyCommon.WriteLog("删除图片", "删除图片ID:" + this.txtuids.Value, this.Session["hy_id"].ToString(), this.Session["hy_name"].ToString()); // LoadingPictures(); Response.Write("<script>location.replace(location);</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 Page_Load(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); if (this.Request.QueryString["cid"] != null) this.pis_cid = JpCommon.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9); string ls_where = " and cid like '" + pis_cid + "%' and sfzwd='否' "; TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle(); this.pis_totalCount = JpArticle.SearchdocsByKeyNum(ls_where); }
protected void Page_Load(object sender, EventArgs e) { string ls_cid = "", ls_page = "1", la_pagesize = "10"; TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); if (this.Request.QueryString["cid"] != null) { ls_cid = JpCommon.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9); } if (this.Request.QueryString["page"] != null) { ls_page = JpCommon.Filter(this.Request.QueryString["page"].ToString()); } if (this.Request.QueryString["pagesize"] != null) { la_pagesize = JpCommon.Filter(this.Request.QueryString["pagesize"].ToString()); } //根据传入的文章栏目ID、页码、页数返回列表信息 TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle(); string ls_where = "", ls_order = ""; ls_where = " and cid like '" + ls_cid + "%' and sfzwd='否' "; ls_order = " order by pubtime desc"; DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, int.Parse(ls_page), int.Parse(la_pagesize)); //复制一个DataTalbe DataTable tempTable = dt.Clone(); //在现有的DatatTable增加一列 DataColumn col = new DataColumn("showTime", typeof(String)); //将列添加到DataTable中去 tempTable.Columns.Add(col); //在现有的DatatTable增加一列 DataColumn col2 = new DataColumn("commentCount", typeof(String)); //将列添加到DataTable中去 tempTable.Columns.Add(col2); int commentCount = 0; JpComment jpComment = new JpComment(); //循环 对DataTable重新赋值 for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[tempTable.Columns[j].ColumnName] = dt.Rows[i][j]; } DataTable dtComment = jpComment.Getdocsbyaid_ysh(ls_cid, dt.Rows[i]["aid"].ToString()); commentCount = dtComment.Rows.Count; //获得间隔的时间 dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["crtime"].ToString())); dr["commentCount"] = commentCount; tempTable.Rows.Add(dr); } //转换成json格式 string strJson = JsonConvert.SerializeObject(tempTable); //数据抛出 Response.Write(strJson); }
protected void Page_Load(object sender, EventArgs e) { string strType = "", ls_page = "1", la_pagesize = "10"; TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); //获取参数 if (this.Request.QueryString["type"] != null) { strType = this.Request.QueryString["type"].ToString(); } if (this.Request.QueryString["page"] != null) { ls_page = this.Request.QueryString["page"].ToString(); } if (this.Request.QueryString["pagesize"] != null) { la_pagesize = this.Request.QueryString["pagesize"].ToString(); } string ls_where = "", ls_order = ""; //构造sql if (strType == "1") { ls_where = " and (hy_ifsh ='1' or hy_ifsh='2') "; } else if (strType == "2") { ls_where = " and hy_ifsh ='0' "; } ls_order = " order by hy_addtime desc"; JpHelp jpHelp = new JpHelp(); //获取数据 DataTable dt = jpHelp.SearchdocsByKey(ls_where, ls_order, int.Parse(ls_page), int.Parse(la_pagesize)); //复制一个DataTalbe DataTable tempTable = dt.Clone(); //在现有的DatatTable增加一列 DataColumn col = new DataColumn("showTime", typeof(String)); //将列添加到DataTable中去 tempTable.Columns.Add(col); //循环 对DataTable重新赋值 for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[tempTable.Columns[j].ColumnName] = dt.Rows[i][j]; } //获得间隔的时间 dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["hy_addtime"].ToString())); tempTable.Rows.Add(dr); } //转换成json格式 string strJson = JsonConvert.SerializeObject(tempTable); //数据抛出 Response.Write(strJson); }
//关健字查询 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 Page_Load(object sender, EventArgs e) { string ls_page = "1", ls_pagesize = "10"; TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); //获取参数 if (this.Request.QueryString["page"] != null) { ls_page = this.Request.QueryString["page"].ToString(); } if (this.Request.QueryString["pagesize"] != null) { ls_pagesize = this.Request.QueryString["pagesize"].ToString(); } string ls_where = " and hy_ifsh ='2' "; string ls_orderby = " order by hy_addtime desc "; JpPhotography jpPhotography = new JpPhotography(); //获取数据 string test = ""; DataTable dt = jpPhotography.SearchdocsByKey(ls_where,ls_orderby, int.Parse(ls_page), int.Parse(ls_pagesize)); Response.Write(test); //复制一个DataTalbe DataTable tempTable = dt.Clone(); //在现有的DatatTable增加一列 DataColumn col = new DataColumn("showTime", typeof(String)); //将列添加到DataTable中去 tempTable.Columns.Add(col); //在现有的DatatTable增加一列 DataColumn co2 = new DataColumn("showImg", typeof(String)); //将列添加到DataTable中去 tempTable.Columns.Add(co2); //循环 对DataTable重新赋值 for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[tempTable.Columns[j].ColumnName] = dt.Rows[i][j]; } //获得间隔的时间 dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["hy_addtime"].ToString())); HyFileatt hyFileatt = new HyFileatt(); DataTable dt_img = hyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString()); if (dt_img.Rows.Count > 0) { dr["showImg"] = dt_img.Rows[0]["hy_filepath"].ToString(); } tempTable.Rows.Add(dr); } //转换成json格式 string strJson = JsonConvert.SerializeObject(tempTable); //数据抛出 Response.Write(strJson); }
protected void Page_Load(object sender, EventArgs e) { JpCommon JpCommon = new JpCommon(); if (this.Request.QueryString["cid"] != null) { this.txtcid.Value = this.Request.QueryString["cid"].ToString(); this.pis_cid = JpCommon.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9); } string ls_where = " and cid = '" + this.txtcid.Value + "' and sfzwd='是'"; JpArticle JpArticle = new JpArticle(); this.pis_totalCount = JpArticle.SearchdocsByKeyNum(ls_where); }
//保存 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 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>"); }
private void RptBind() { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); if (this.Request.QueryString["cid"] != null) this.pis_cid = JpCommon.queryString2StrID(this.Request.QueryString["cid"].ToString(),9); TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle(); string ls_where = " and cid like '" + pis_cid + "%' "; string ls_order = " order by pubtime desc"; DataTable dt = JpArticle.SearchdocsByKey(ls_where, ls_order, 1, 4); rptList.DataSource = dt; rptList.DataBind(); this.pis_totalCount = JpArticle.SearchdocsByKeyNum(ls_where); }
protected void Page_Load(object sender, EventArgs e) { TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); if (this.Request.QueryString["cid"] != null) this.cid = JpCommon.queryString2StrID(this.Request.QueryString["cid"].ToString(), 9); if (this.Request.QueryString["aid"] != null) this.aid = JpCommon.queryString2StrID(this.Request.QueryString["aid"].ToString(), 9); if (!this.IsPostBack) { this.txtDocid.Value = System.Guid.NewGuid().ToString(); } DataPlay(); }
protected void Page_Load(object sender, EventArgs e) { string ls_aid="",ls_cid="",strType = "", ls_page = "1", la_pagesize = "10"; TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon(); //获取参数 if (this.Request.QueryString["type"] != null) { strType = this.Request.QueryString["type"].ToString(); } if (this.Request.QueryString["page"] != null) { ls_page = this.Request.QueryString["page"].ToString(); } if (this.Request.QueryString["cid"] != null) { ls_cid = this.Request.QueryString["cid"].ToString(); } if (this.Request.QueryString["pagesize"] != null) { la_pagesize = this.Request.QueryString["pagesize"].ToString(); } 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, int.Parse(ls_page), int.Parse(la_pagesize)); DataTable tempTable = dt.Clone(); //在现有的DatatTable增加一列 DataColumn col = new DataColumn("showTime", typeof(String)); //将列添加到DataTable中去 tempTable.Columns.Add(col); //循环 对DataTable重新赋值 for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[tempTable.Columns[j].ColumnName] = dt.Rows[i][j]; } //获得间隔的时间 dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["crtime"].ToString())); tempTable.Rows.Add(dr); } //转换成json格式 string strJson = JsonConvert.SerializeObject(tempTable); //数据抛出 Response.Write(strJson); }
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); TPortalClass.JpComment JpComment = new TPortalClass.JpComment(); TPortalClass.JpUserVip JpUserVip = new TPortalClass.JpUserVip(); DataTable dt = JpComment.Getdocsbyaid_ysh_fy(ls_aid, ls_cid, Convert.ToInt32(ls_page), Convert.ToInt32(ls_pagesize)); DataTable tempTable = dt.Clone(); DataColumn col1 = new DataColumn("rytx", typeof(String)); DataColumn col2 = new DataColumn("showTime", typeof(String)); tempTable.Columns.Add(col1); tempTable.Columns.Add(col2); for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); string ls_user = dt.Rows[i]["usid"].ToString(); DataTable dtrytx = JpUserVip.GetJpUserPic(ls_user); if (dtrytx.Rows.Count > 0) { dr["rytx"] = dtrytx.Rows[0]["hy_pic"].ToString(); } else { dr["rytx"] = "images/1211p1.png"; } dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["commenttime"].ToString())); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } tempTable.Rows.Add(dr); } //转换成json格式 string strJson = JsonConvert.SerializeObject(tempTable); //数据抛出 Response.Write(strJson); }
//批量删除 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.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>"); }
public String RptBind() { StringBuilder stringBuilder = new StringBuilder(); JpCommon JpCommon = new JpCommon(); if (this.Request.QueryString["aid"] != null) { this.pis_aid = JpCommon.queryString2StrID(this.Request.QueryString["aid"].ToString(), 9); } JpArticle JpArticle = new JpArticle(); DataTable dt = JpArticle.GetArticleByaid(int.Parse(pis_aid)); if (dt.Rows.Count > 0) { pis_cid = dt.Rows[0]["cid"].ToString(); this.lbljptx.Text = "<h1>\"" + dt.Rows[0]["title"].ToString() + "\"</h1><span><img src=\"" + dt.Rows[0]["indexdisplaypicpath"].ToString() + "\"></span>"; } string ls_where = " and cid = '" + pis_cid + "' and zwdid=" + pis_aid + " and sfzwd='否' "; string ls_order = " order by pubtime desc"; DataTable dt2 = JpArticle.SearchdocsByKey(ls_where, ls_order, 1, 5); string strTitle = ""; if (dt2.Rows.Count > 0) { for (int i = 0; i < dt2.Rows.Count; i++) { strTitle = dt2.Rows[i]["title"].ToString(); if (strTitle.Length > 18) { strTitle = strTitle.Substring(0, 18) + "..."; } stringBuilder.Append("<a onclick=\"locationDetail('art_detail.aspx?aid=" + dt2.Rows[i]["aid"].ToString() + "','" + locationType + "','0')\"><li>"); if (dt2.Rows[i]["indexdisplaypicpath"].ToString() != "") { stringBuilder.Append("<img src=\"" + dt2.Rows[i]["indexdisplaypicpath"].ToString() + "\">"); } else { stringBuilder.Append("<img src=\"/images/noImg.jpg\">"); } stringBuilder.Append("<h1>"); stringBuilder.Append("" + strTitle + "</h1><p class=\"fleft\">" + JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt2.Rows[i]["crtime"].ToString())) + "</p></li></a>"); } } return stringBuilder.ToString(); }
//保存 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 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>"); }