📄 mo_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_Manage : System.Web.UI.Page
{
public string nowTp = "0";
BasePage bp = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!PowerTree.PowerPass.isPass("010001000", PowerTree.PowerPanel.PowerType.look))
{
bp = new BasePage();
bp.PageError("对不起,你没有查看该页面的权限!", "../index.aspx");
}
if (!IsPostBack)
{
//删除模板方案-----------------
if ((!string.IsNullOrEmpty(Request.QueryString["TPID"])) && Request["delaction"] == "del")
{
if (!PowerTree.PowerPass.isPass("010001003", PowerTree.PowerPanel.PowerType.del))
{
bp = new BasePage();
bp.PageError("对不起,你没有删除模板的权限!", "../index.aspx");
}
else
{
try
{
int mid = Convert.ToInt32(Request.QueryString["TPID"]);
DelAction(mid);
}
catch { }
}
}
//-------------------------------
//更新模板方案状态-------------------
if ((!string.IsNullOrEmpty(Request.QueryString["action"])) && (!string.IsNullOrEmpty(Request.QueryString["TPID"])))
{
if (!PowerTree.PowerPass.isPass("010001006", PowerTree.PowerPanel.PowerType.other))
{
bp = new BasePage();
bp.PageError("对不起,你没有修改模板状态的权限!", "../index.aspx");
}
else
{
try
{
int mid = Convert.ToInt32(Request.QueryString["TPID"]);
OpenOrCloseAction(Request.QueryString["action"], mid);
}
catch { }
}
}
//---------------------------------
BindData();
nowTp = GetNowTP().ToString();
}
}
public void BindData()
{
Templates_List.DataSource = YXShop.TemplateAction.TemplateDo.GetTemplateList1();
Templates_List.DataBind();
}
public void OpenOrCloseAction(string _action, int _id)
{
if (_action == "off")
{
YXShop.TemplateAction.TemplateDo.UpdateTemplateStatus(0, _id);//停止
}
else
{
YXShop.TemplateAction.TemplateDo.UpdateTemplateStatus(1, _id);//开启
}
}
public int GetNowTP()
{
try
{
return (int)YXShop.DBUtility.SqlHelper.ExecuteScalar(YXShop.DBUtility.SqlHelper.ConnectionStringLocalTransactionHr, CommandType.Text, "select top 1 TP_ID from YX_TemplateProgramme", null);
}
catch { return 0; }
}
public void DelAction(int _id)
{
YXShop.TemplateAction.TemplateDo.DelTemplate(_id);
}
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
{
try
{
string id = ((LinkButton)sender).CommandArgument;
YXShop.TemplateAction.TemplateDo.CopyTemplate(int.Parse(id));
BindData();
}
catch { }
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -