//保存排序 protected void btnSave_Click(object sender, EventArgs e) { ChkAdminLevel("channel_" + this.channel_name + "_category", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.article_category bll = new BLL.article_category(); 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(), "保存" + this.channel_name + "频道栏目分类排序"); //记录日志 JscriptMsg("保存排序成功!", Utils.CombUrlTxt("category_list.aspx", "channel_id={0}", this.channel_id.ToString())); }
protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Recommended") { BLL.article_category bll = new BLL.article_category(); //Model.article_category model = bll.GetModel(int.Parse(e.CommandArgument.ToString())); bll.UpdateField(int.Parse(e.CommandArgument.ToString()), " IsRecommended=1 "); JscriptMsg("设置成功!", Utils.CombUrlTxt("category_list.aspx", "channel_id={0}", this.channel_id.ToString()), "Success"); } else if (e.CommandName == "CancelRecommended") { BLL.article_category bll = new BLL.article_category(); //Model.article_category model = bll.GetModel(int.Parse(e.CommandArgument.ToString())); bll.UpdateField(int.Parse(e.CommandArgument.ToString()), " IsRecommended=0 "); JscriptMsg("取消成功!", Utils.CombUrlTxt("category_list.aspx", "channel_id={0}", this.channel_id.ToString()), "Success"); } }