📄 deliverlist.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 YXShop.Common;
using System.Collections.Generic;
using Shop.Web.UI;
namespace YXShop.Web.Admin.Product
{
public partial class DeliverList : System.Web.UI.Page
{
YXShop.BLL.YXShop_Deliver bll = new YXShop.BLL.YXShop_Deliver();
public PageSet ps;
BasePage bp = null;
protected void Page_Load(object sender, EventArgs e)
{
bp = new BasePage();
if (!PowerTree.PowerPass.isPass("005001000",PowerTree.PowerPanel.PowerType.look))
{
bp.PageError("对不起,你没有查看此页面的权限!", "../index.aspx");
}
AjaxPro.Utility.RegisterTypeForAjax(typeof(YXShop.Web.Admin.Product.DeliverList));
if ((!IsPostBack) || ((Request["Event"] != null) && (Request["Event"] != "")))
{
Bind();
}
}
private void Bind()
{
int pageIndex = Request["pageIndex"] == null ? 0 : int.Parse(Request["pageIndex"]);
if (pageIndex < 0)
{
pageIndex = 0;
}
if ((Request["Event"] == null) || (Request["Event"] == ""))
{
pageIndex = 0;
}
string str = string.Format("");
DataSet datas = bll.GetAllList(str);
GridView1.DataSource = datas;
ps = new PageSet(datas.Tables[0].Rows.Count, PageSet.PageSize, pageIndex);
if (ps.PageCount <= pageIndex + 1)
{
pageIndex = ps.PageCount - 1;
}
GridView1.PageSize = PageSet.PageSize;
GridView1.PageIndex = pageIndex;
if (datas.Tables[0].Rows.Count < 1)
{
GridView1.BackColor = System.Drawing.Color.White;
}
GridView1.DataBind();
}
[AjaxPro.AjaxMethod]
public void ItemDel(int id)
{
if (!PowerTree.PowerPass.isPass("005001003", PowerTree.PowerPanel.PowerType.del))
{
return;
}
bll.Delete(id);
}
[AjaxPro.AjaxMethod]
public void ItemListDel(string str)
{
string[] idList = str.Split(',');
for (int i = 0; i < idList.Length; i++)
{
if (isNumeric(idList[i]))
ItemDel(Convert.ToInt32(idList[i]));
}
}
[AjaxPro.AjaxMethod]
public bool isNumeric(string num)
{
if (num.Length == 0)
{
return false;
}
System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex("^[0-9]+$");
return r.IsMatch(num);
}
public string blStr(object obj)
{
string reStr = string.Empty;
if (obj != null)
{
int blInt = Convert.ToInt32(obj);
if (blInt > 0)
reStr = "是";
else
reStr = "否";
}
return reStr;
}
#region 判断是否具有删除权限
/// <summary>
/// 判断是否具有删除权限
/// </summary>
/// <param name="powertype"></param>
/// <returns></returns>
public string GetPowerStr(string powertype)
{
string reStr = "";
switch (powertype)
{
case "del":
reStr = PowerTree.PowerPass.isPass("005001003", PowerTree.PowerPanel.PowerType.del) ? "t" : "f";
break;
}
return reStr;
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -