コード例 #1
0
ファイル: category_list.aspx.cs プロジェクト: rockhe168/CMS
 //保存排序
 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()));
 }
コード例 #2
0
 //保存排序
 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()));
 }
コード例 #3
0
 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");
     }
 }
コード例 #4
0
 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");
     }
 }