protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { this.ChkAdminLevel("channel_" + this.channel_name + "_list", DTEnums.ActionEnum.Edit.ToString()); int int32 = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value); Rain.BLL.article article = new Rain.BLL.article(); Rain.Model.article model = article.GetModel(int32); switch (e.CommandName) { case "lbtnIsMsg": if (model.is_msg == 1) { article.UpdateField(int32, "is_msg=0"); break; } article.UpdateField(int32, "is_msg=1"); break; case "lbtnIsTop": if (model.is_top == 1) { article.UpdateField(int32, "is_top=0"); break; } article.UpdateField(int32, "is_top=1"); break; case "lbtnIsRed": if (model.is_red == 1) { article.UpdateField(int32, "is_red=0"); break; } article.UpdateField(int32, "is_red=1"); break; case "lbtnIsHot": if (model.is_hot == 1) { article.UpdateField(int32, "is_hot=0"); break; } article.UpdateField(int32, "is_hot=1"); break; case "lbtnIsSlide": if (model.is_slide == 1) { article.UpdateField(int32, "is_slide=0"); break; } article.UpdateField(int32, "is_slide=1"); break; } this.RptBind(this.channel_id, this.category_id, "id>0" + this.CombSqlTxt(this.keywords, this.property), "sort_id asc,add_time desc,id desc"); }
protected void btnAudit_Click(object sender, EventArgs e) { this.ChkAdminLevel("channel_" + this.channel_name + "_list", DTEnums.ActionEnum.Audit.ToString()); Rain.BLL.article article = new Rain.BLL.article(); Repeater repeater1 = new Repeater(); Repeater repeater2; switch (this.prolistview) { case "Txt": repeater2 = this.rptList1; break; default: repeater2 = this.rptList2; break; } for (int index = 0; index < repeater2.Items.Count; ++index) { int int32 = Convert.ToInt32(((HiddenField)repeater2.Items[index].FindControl("hidId")).Value); if (((CheckBox)repeater2.Items[index].FindControl("chkId")).Checked) { article.UpdateField(int32, "status=0"); } } this.AddAdminLog(DTEnums.ActionEnum.Audit.ToString(), "审核" + this.channel_name + "频道内容信息"); this.JscriptMsg("批量审核成功!", Utils.CombUrlTxt("article_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}", this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property)); }
protected void btnSave_Click(object sender, EventArgs e) { this.ChkAdminLevel("channel_" + this.channel_name + "_list", DTEnums.ActionEnum.Edit.ToString()); Rain.BLL.article article = new Rain.BLL.article(); Repeater repeater1 = new Repeater(); Repeater repeater2; switch (this.prolistview) { case "Txt": repeater2 = this.rptList1; break; default: repeater2 = this.rptList2; break; } for (int index = 0; index < repeater2.Items.Count; ++index) { int int32 = Convert.ToInt32(((HiddenField)repeater2.Items[index].FindControl("hidId")).Value); int result; if (!int.TryParse(((TextBox)repeater2.Items[index].FindControl("txtSortId")).Text.Trim(), out result)) { result = 99; } article.UpdateField(int32, "sort_id=" + result.ToString()); } this.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "保存" + this.channel_name + "频道内容排序"); this.JscriptMsg("保存排序成功!", Utils.CombUrlTxt("article_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}", this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property)); }