📄 channel_class_modify.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using YXShop.Model;
using Shop.Web.UI;
namespace YXShop.Web.Admin.Article
{
public partial class Channel_Class_Modify : System.Web.UI.Page
{
public string channelBar = "";
public string ClassID = "";
BasePage bp = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!PowerTree.PowerPass.isPass("012002004", PowerTree.PowerPanel.PowerType.update))
{
bp = new BasePage();
bp.PageError("对不起,你没有修改分类的权限!", "../index.aspx");
}
if (Request["Class_ID"] != null)
{
this.ClassID = Request["Class_ID"].ToString();
}
else
{
YXShop.Common.alert.show("对不起!参数传递错误!");
}
if (!Page.IsPostBack)
{
BindClass(this.ClassID);
Class_Name.Attributes.Add("onblur", "this.value=this.value.replace(/\\s/g,'');");
}
}
#region 数据绑定
public void BindClass(string Class_ID)
{
YXShop.BLL.YixiangChannelClass bll = new YXShop.BLL.YixiangChannelClass();
YXShop.Model.TBClass tbclassObj=bll.GetSingleClassInfo(Class_ID);
YXShop.BLL.YixiangChannel bllChannel = new YXShop.BLL.YixiangChannel();
// YXJob.Model.Yixiang_channel tbchannelObj = bllChannel.GetSingleChannelInfo(tbclassObj.Channel_ID.ToString());
string str = "Select YX_Name from YX_InforChannel where YX_ID=" + int.Parse(tbclassObj.Channel_ID.ToString());
string name = YXShop.DBUtility.SqlHelper.ExecuteScalar(YXShop.DBUtility.SqlHelper.ConnectionStringLocalTransactionHr, CommandType.Text, str, null).ToString();
Class_Channel.Text = name;
channelBar = bllChannel.ChannelNavigation(tbclassObj.Channel_ID.ToString());
if (tbclassObj.Parent_ID.ToString() == "0")
{
Class_Kind.Text = "顶级栏目";
}
else
{
Class_Kind.Text = bll.GetSingleClassInfo(tbclassObj.Parent_ID.ToString()).Class_Name.ToString();
}
Class_Name.Text = tbclassObj.Class_Name.ToString();
Class_Des.Text = tbclassObj.Class_Des.ToString();
Parent_ID.Text = tbclassObj.Parent_ID.ToString();
Class_Id.Text = tbclassObj.Class_ID.ToString();
Class_Depth.Text = "该类别属于第:<b><font color='red'>"+tbclassObj.Class_Depth.ToString()+"</font></b>级类别";
}
#endregion
#region 修改文章分类信息
protected void modiBtn_Click(object sender, EventArgs e)
{
string className = YXShop.Common.WebUtility.InputText(Class_Name.Text.ToString(), Class_Name.Text.ToString().Length);
string classDes = YXShop.Common.WebUtility.GetLenghtAll(YXShop.Common.WebUtility.InputText(Class_Des.Text.ToString(), Class_Des.Text.ToString().Length), 800);
string parentId = YXShop.Common.WebUtility.InputText(Parent_ID.Text.ToString(), Parent_ID.Text.ToString().Length);
string classId = YXShop.Common.WebUtility.InputText(Class_Id.Text.ToString(), Class_Id.Text.ToString().Length);
if (className != "" && parentId!="" && classId!="")
{
YXShop.BLL.YixiangChannelClass bll = new YXShop.BLL.YixiangChannelClass();
if(bll.UpdateChannelClassDetail(classId, className,classDes)==0)
{
YXShop.Common.alert.showOnly("修改成功!");
}
else
{
YXShop.Common.alert.showOnly("修改失败!");
}
}
BindClass(this.ClassID);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -