SuLei.Web/admin/article/category_list.aspx.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Text;
using System.Data;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SuLei.Common;
using SuLei.UI;
namespace SuLei.Web.admin.article
{
public partial class category_list : ManagePage
{
protected int channel_id;
protected string channel_name = string.Empty; //频道名称
protected void Page_Load(object sender, EventArgs e)
{
this.channel_id =SLRequest.GetQueryInt("channel_id");
this.channel_name = new BLL.sl_site_channel().GetChannelName(this.channel_id); //取得频道名称
if (this.channel_id == 0)
{
JscriptMsg("频道参数不正确!", "back");
return;
}
if (!Page.IsPostBack)
{
ChkAdminLevel("channel_" + this.channel_name + "_category", SLEnums.ActionEnum.View.ToString()); //检查权限
RptBind();
}
}
//数据绑定
private void RptBind()
{
BLL.sl_article_category bll = new BLL.sl_article_category();
DataTable dt = bll.GetList(0, this.channel_id);
this.rptList.DataSource = dt;
this.rptList.DataBind();
}
//保存排序
protected void btnSave_Click(object sender, EventArgs e)
{
ChkAdminLevel("channel_" + this.channel_name + "_category", SLEnums.ActionEnum.Edit.ToString()); //检查权限
BLL.sl_article_category bll = new BLL.sl_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(SLEnums.ActionEnum.Edit.ToString(), "保存" + this.channel_name + "频道栏目分类排序"); //记录日志
JscriptMsg("保存排序成功!", Utils.CombUrlTxt("category_list.aspx", "channel_id={0}", this.channel_id.ToString()));
}
后面还有 20 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
