📄 mo_templatecontent_manage.aspx.cs
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Shop.Web.UI;
namespace YXShop.Web.Admin.Templates
{
public partial class Mo_TemplateContent_Manage : System.Web.UI.Page
{
public int pageIndexNow = 1;//页码
public string ShowPageText = "";
BasePage bp = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!PowerTree.PowerPass.isPass("010002000", PowerTree.PowerPanel.PowerType.look))
{
bp = new BasePage();
bp.PageError("对不起,你没有查看该页面的权限!", "../index.aspx");
}
if (Request.QueryString["page"] != null)
{
try
{
this.pageIndexNow = Convert.ToInt32(Request.QueryString["page"]);
}
catch {
this.pageIndexNow = 1;
}
}
else
{
this.pageIndexNow = 1;
}
if (!IsPostBack)
{
if (!string.IsNullOrEmpty(Request["TP_ID"]))
{
BindData(Request["TP_ID"], Request["Channel_ID"], Request["Type_ID"], Request["IsDefault"]);
}
}
}
public void BindData(string _tp_Id,string _channelId,string _type,string _isDefault)
{
string strWhere = " Mo_ID<>0 ";
string strOrder = "";
if (!string.IsNullOrEmpty(_tp_Id))
{
strWhere += " and Mo_Tp="+_tp_Id+"";
strOrder = "Mo_Channel";
}
if (!string.IsNullOrEmpty(_channelId))
{
strWhere += " and Mo_Channel=" + _channelId + "";
strOrder = "Mo_Type";
}
if (!string.IsNullOrEmpty(_type))
{
strWhere += " and Mo_Type=" + _type + "";
}
if (_isDefault=="1")
{
strWhere += " and Mo_IsDefault=1";
}
YXShop.TemplateAction.DataSelect pager = new YXShop.TemplateAction.DataSelect();
Templates_List.DataSource = pager.GetData("YX_Templates", this.pageIndexNow, 20, "Mo_ID,Mo_Name,Mo_Tp,Mo_Channel,Mo_Type,Mo_Content,Mo_IsDefault", "Mo_ID", strWhere, strOrder);
Templates_List.DataBind();
this.ShowPageText = pager.PageText("?TP_ID=" + Request["TP_ID"] + "&Channel_ID=" + Request["Channel_ID"] + "&Type_ID=" + Request["Type_ID"] + "&IsDefault=" + Request["IsDefault"] + "");
}
protected void copyBTN_OnClick(object sender, EventArgs e)
{
if (!PowerTree.PowerPass.isPass("010001007", PowerTree.PowerPanel.PowerType.other))
{
bp = new BasePage();
bp.PageError("对不起,你没有复制模板的权限!", "../index.aspx");
}
else
{
string id = ((LinkButton)sender).CommandArgument;
YXShop.TemplateAction.TemplateDo.CopyTemplateContent(int.Parse(id));
BindData(Request["TP_ID"], Request["Channel_ID"], Request["Type_ID"], Request["IsDefault"]);
}
}
protected void delBtn_OnClick(object sender, EventArgs e)
{
if (!PowerTree.PowerPass.isPass("010002003", PowerTree.PowerPanel.PowerType.del))
{
bp = new BasePage();
bp.PageError("对不起,你没有删除模板的权限!", "../index.aspx");
}
else
{
string id = ((LinkButton)sender).CommandArgument;
YXShop.TemplateAction.TemplateDo.DelTemplateContent(int.Parse(id));
BindData(Request["TP_ID"], Request["Channel_ID"], Request["Type_ID"], Request["IsDefault"]);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -