📄 temporarilylist.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;
namespace YXShop.Web.Membercenter.Dynamic
{
public partial class TemporarilyList : System.Web.UI.Page
{
YXShop.BLL.Temporarily bll=new YXShop.BLL.Temporarily();
public PageSet ps;
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(YXShop.Web.Membercenter.Dynamic.TemporarilyList));
if ((!IsPostBack) || (string.IsNullOrEmpty(Request["Event"])))
{
if (Session["MemberID"] != null)
{
BindTemporarily(Convert.ToInt32(Session["MemberID"]));
}
}
}
#region Bind Data
private void BindTemporarily(int UserId)
{
int pageIndex = Request["pageIndex"] == null ? 0 : int.Parse(Request["pageIndex"]);
if (pageIndex < 0)
{
pageIndex = 0;
}
if ((Request["Event"] == null) || (Request["Event"] == ""))
{
pageIndex = 0;
}
List<YXShop.Model.Temporarily> datas = bll.GetList("UserID_tm",UserId);
GridView1.DataSource = datas;
int RecordCount = 0;
if (datas != null)
RecordCount = datas.Count;
ps = new PageSet(RecordCount, PageSet.PageSize, pageIndex);
if (ps.PageCount <= pageIndex + 1)
{
pageIndex = ps.PageCount - 1;
}
GridView1.PageSize = PageSet.PageSize;
GridView1.PageIndex = pageIndex;
if (RecordCount < 1)
{
GridView1.BackColor = System.Drawing.Color.White;
}
else
{
GridView1.BackColor = System.Drawing.Color.FromArgb(0x5D, 0x8F, 0xB2);
}
GridView1.DataBind();
}
#endregion
[AjaxPro.AjaxMethod]
public int DelItem(int UserID, int ProID)
{
int cRows = 0;
YXShop.Model.Temporarily model = new YXShop.Model.Temporarily();
model.UserID_tm = UserID;
model.ProductID_tm = ProID;
try
{
cRows = bll.Delete(model, false);
}
catch { }
return cRows;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -