📄 mo_templatecontent_add.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_Add : System.Web.UI.Page
{
BasePage bp = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!PowerTree.PowerPass.isPass("010002002", PowerTree.PowerPanel.PowerType.add))
{
bp = new BasePage();
bp.PageError("对不起,你没有添加模板的权限!", "../index.aspx");
}
if (!IsPostBack)
{
YXShop.Common.WebUtility.WebControlOnblur(this.MO_Name);//去除空格
BindData();
}
}
public void BindData()
{
Tp_List_Bind();
if (TP_List.Items.Count <= 0)
{
TP_List.Visible = false;
msgkind.Text = "请[<a href='Mo_Add.aspx' style='color:red'>添加模板方案</a>]";
AddBtn.Visible = false;
viewBtn.Visible = false;
msgbtn.Text = "温馨提示:当前暂无任何模板方案!请先[<a href='Mo_Add.aspx' style='color:red'>添加模板方案</a>]后再添加模板";
}
}
public void Tp_List_Bind()
{
TP_List.DataSource= YXShop.TemplateAction.TemplateDo.GetTemplateList();
TP_List.DataTextField = "TP_Name";
TP_List.DataValueField = "TP_ID";
TP_List.DataBind();
}
protected void AddBtn_Click(object sender, EventArgs e)
{
if (TP_List.SelectedIndex != -1 && (!string.IsNullOrEmpty(Request["channel"])) && (!string.IsNullOrEmpty(Request["type"])))
{
if ((!string.IsNullOrEmpty(MO_Name.Text)) && (!string.IsNullOrEmpty(TP_List.SelectedValue)) && (!string.IsNullOrEmpty(Request["channel"])) && (!string.IsNullOrEmpty(Request["type"])) && (!string.IsNullOrEmpty(templateContent.Text)))
{
int result= YXShop.TemplateAction.TemplateDo.AddTemplate(MO_Name.Text, TP_List.SelectedValue, Request["channel"], Request["type"], templateContent.Text,isDefault.Checked==true? "1":"0" );
if (result > -1)
{
msg.Text = "<font color='red'>温馨提示:添加模板<font color='blue'>"+MO_Name.Text+"</font>成功!</font>";
MO_Name.Text = "";
templateContent.Text = "";
isDefault.Checked = false;
}
}
}
}
protected void viewBtn_Click(object sender, EventArgs e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -