//设置操作 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { ChkAdminLevel("plugin_link", DTEnums.ActionEnum.Edit.ToString()); //检查权限 int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value); BLL.plugin_link bll = new BLL.plugin_link(); Model.plugin_link model = bll.GetModel(id); switch (e.CommandName.ToLower()) { case "lbtnisred": if (model.is_red == 1) { bll.UpdateField(id, "is_red=0"); } else { bll.UpdateField(id, "is_red=1"); } break; } this.RptBind("id>0" + CombSqlTxt(this.property, this.keywords), "sort_id asc,add_time desc"); }
//批量审核 protected void lbtnUnLock_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_link", DTEnums.ActionEnum.Audit.ToString()); //检查权限 BLL.plugin_link bll = new BLL.plugin_link(); 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=0"); } } AddAdminLog(DTEnums.ActionEnum.Audit.ToString(), "审核友情链接"); //记录日志 JscriptMsg("批量审核成功!", Utils.CombUrlTxt("index.aspx", "site_id={0}&property={1}&keywords={2}", this.site_id.ToString(), this.property.ToString(), this.keywords)); }
//保存排序 protected void lbtnSave_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_link", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.plugin_link bll = new BLL.plugin_link(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); int sortId; if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } bll.UpdateField(id, "sort_id=" + sortId.ToString()); } AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改友情链接插件排序:"); //记录日志 JscriptMsg("保存排序成功!", Utils.CombUrlTxt("index.aspx", "site_id={0}&property={1}&keywords={2}", this.site_id.ToString(), this.property.ToString(), this.keywords)); }