📄 shopcategory.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 System.Collections.Generic;
using YXShop.Common;
using Shop.Web.UI;
namespace YXShop.Web.Admin.Shop
{
public partial class ShopCategory : System.Web.UI.Page
{
BLL.ShopCategory B_ShopCategory = new YXShop.BLL.ShopCategory();
BasePage bp = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!PowerTree.PowerPass.isPass("014001000", PowerTree.PowerPanel.PowerType.look))
{
bp = new BasePage();
bp.PageError("对不起,你没有查看此页面的权限!","../index.aspx");
}
if (!IsPostBack)
{
BindData();
}
}
void BindData()
{
rptCategory.DataSource = B_ShopCategory.GetAll();
rptCategory.DataBind();
}
protected void lbtOperation(object s, EventArgs e)
{
Model.ShopCategory M_ShopCategory = new YXShop.Model.ShopCategory();
string type = ((LinkButton)s).CommandName;
string id = ((LinkButton)s).CommandArgument;
switch (type)
{
case "Use":
if (!PowerTree.PowerPass.isPass("014001004", PowerTree.PowerPanel.PowerType.update))
{
bp = new BasePage();
bp.PageError("对不起,你没有修改店铺类型的权限!", "../index.aspx");
}
else
{
if (B_ShopCategory.Amend(Convert.ToInt32(id.Split(',')[0]), "IsUse", id.Split(',')[1] == "1" ? 0 : 1) > 0)
{
alert.showAndGo("改变状态成功", Request.Url.ToString());
}
else
{
alert.showOnly("改变状态失败");
}
}
break;
case "Del":
if (!PowerTree.PowerPass.isPass("014001003", PowerTree.PowerPanel.PowerType.del))
{
bp = new BasePage();
bp.PageError("对不起,你没有删除店铺类型的权限!", "../index.aspx");
}
else
{
M_ShopCategory.scID = Convert.ToInt32(id);
if (B_ShopCategory.Delete(M_ShopCategory) > 0)
{
alert.showAndGo("删除店铺类型成功", Request.Url.ToString());
}
else
{
alert.showOnly("删除店铺类型失败");
}
}
break;
// case "Up":
// //Up(Convert.ToInt32(id));
// Move("Up", Convert.ToInt32(id));
// BindData(Convert.ToInt32(ViewState["FID"]));
// break;
// case "Down":
// //List<Model.Provinces> NextProv = B_Provinces.GetListByColumn("previd=" + id);
// //if (NextProv.Count > 0)
// //{
// // Up(NextProv[0].ID);
// //}
// //else
// //{
// // alert.showOnly("你已经在最下级!");
// // Response.End();
// //}
// Move("Down", Convert.ToInt32(id));
// BindData(Convert.ToInt32(ViewState["FID"]));
// break;
//}
}
}
public bool MoveEnabled(string dataType, int ID)
{
//List<Model.ShopCategory> listShopCategory = B_ShopCategory.GetListByColumn("scID", ID);
//int orderId = 1;
//if (listShopCategory.Count > 0)
//{
// orderId = listShopCategory[0].scOrderBy;
//}
//else
//{ return true; }
//bool Show = false;
//switch (dataType)
//{
// case "Up":
// List<Model.Provinces> listProvincesProv = B_Provinces.GetListByColumn(1, "orderid<" + orderId + " Order by orderid desc");
// if (listProvincesProv.Count > 0)
// {
// Show = true;
// }
// break;
// case "Down":
// List<Model.Provinces> listProvincesNext = B_Provinces.GetListByColumn(1, "orderid>" + orderId + " Order by orderid");
// if (listProvincesNext.Count > 0)
// {
// Show = true;
// }
// break;
//}
//return Show;
return false;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -