//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("feedback", OSEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.plugins.feedback bll = new BLL.plugins.feedback(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } AddAdminLog(OSEnums.ActionEnum.Delete.ToString(), "删除留言成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志 Response.Redirect(Utils.CombUrlTxt("list.aspx", "keywords={0}", this.keywords)); }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { ChkAdminLevel("feedback", OSEnums.ActionEnum.Reply.ToString()); //检查权限 BLL.plugins.feedback bll = new BLL.plugins.feedback(); model = bll.GetModel(this.id); model.reply_content = Utils.ToHtml(txtReContent.Text); model.reply_time = DateTime.Now; bll.Update(model); AddAdminLog(OSEnums.ActionEnum.Reply.ToString(), "回复留言插件内容:" + model.title); //记录日志 PageSuccessMsg("留言回复成功!", "", "list.aspx"); }
private void RptBind(string _strWhere, string _orderby) { if (!int.TryParse(Request.QueryString["page"] as string, out this.page)) { this.page = 1; } this.txtKeywords.Text = this.keywords; BLL.plugins.feedback bll = new BLL.plugins.feedback(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//批量审核 protected void lbtnUnLock_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_feedback", OSEnums.ActionEnum.Audit.ToString()); //检查权限 BLL.plugins.feedback bll = new BLL.plugins.feedback(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { bll.UpdateField(id, "is_lock=1"); } } AddAdminLog(OSEnums.ActionEnum.Audit.ToString(), "审核留言插件内容"); //记录日志 Response.Redirect(Utils.CombUrlTxt("list.aspx", "keywords={0}", this.keywords)); }
private void ShowInfo(int _id) { BLL.plugins.feedback bll = new BLL.plugins.feedback(); model = bll.GetModel(_id); txtReContent.Text = Utils.ToTxt(model.reply_content); }