📄 shoppingcartcontent.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.Product
{
public partial class ShoppingCartContent : System.Web.UI.Page
{
public PageSet ps; BasePage bp = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!PowerTree.PowerPass.isPass("004000001", PowerTree.PowerPanel.PowerType.look))
{
bp = new BasePage();
bp.PageError("对不起,你没有查看购物详情的权限!", "../index.aspx");
}
AjaxPro.Utility.RegisterTypeForAjax(typeof(YXShop.Web.Admin.Product.ShoppingCartContent));
if (!IsPostBack)
{
BindData();
YXShop.BLL.ShoppingCart databs = new YXShop.BLL.ShoppingCart();
List<YXShop.Model.ShoppingCart> datams = databs.GetListByColumnProfile("UniqueID", Request.QueryString["id"]);
if (datams.Count > 0)
{
YXShop.BLL.MemberInfo databm = new YXShop.BLL.MemberInfo();
YXShop.BLL.UserCommon ucBll = new YXShop.BLL.UserCommon();
List<YXShop.Model.UserCommon> ucList = ucBll.GetListByColumn("UserName", datams[0].Username);
if (ucList.Count> 0)
{
List<YXShop.Model.MemberInfo> data = databm.GetListByColumn("UID", ucList[0].UID);
if (data.Count > 0)
{
this.lbUserName.Text = datams[0].Username;
this.lbShoppcart.Text = datams[0].LastActivityDate.ToString();
this.lbconName.Text = data[0].cTrueName;
this.lbAddress.Text = data[0].cAddrInfo;
this.lbzip.Text = data[0].post;
this.lbEmail.Text = ucList[0].UEmail; //data[0].uEMail;
this.lbhpone.Text = data[0].cMobilePhone;
}
}
}
}
if ((!IsPostBack) || ((Request["Event"] != null) && (Request["Event"] != "")))
{
BindData();
}
}
#region 列表
private void BindData()
{
int pageIndex = Request["pageIndex"] == null ? 0 : int.Parse(Request["pageIndex"]);
if (pageIndex < 0)
{
pageIndex = 0;
}
if ((Request["Event"] == null) || (Request["Event"] == ""))
{
pageIndex = 0;
}
YXShop.BLL.ShoppingCart data = new YXShop.BLL.ShoppingCart();
List<YXShop.Model.ShoppingCart> datas = data.GetListByColumnCart("UniqueID", Request.QueryString["id"]);
dgTBProductInfo.DataSource = datas;
ps = new PageSet(datas.Count, PageSet.PageSize, pageIndex);
if (ps.PageCount <= pageIndex + 1)
{
pageIndex = ps.PageCount - 1;
}
dgTBProductInfo.PageSize = PageSet.PageSize;
dgTBProductInfo.PageIndex = pageIndex;
if (datas.Count < 1)
{
dgTBProductInfo.BackColor = System.Drawing.Color.White;
}
else
{
dgTBProductInfo.BackColor = System.Drawing.Color.FromArgb(0x5D, 0x8F, 0xB2);
}
dgTBProductInfo.DataBind();
}
protected void dgTBProductInfo_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (!(e.Row.DataItem is YXShop.Model.ShoppingCart))
{
return;
}
YXShop.Model.ShoppingCart data = (e.Row.DataItem as YXShop.Model.ShoppingCart);
if (data != null)
{
e.Row.Cells[4].Text = (data.Price*data.Quantity).ToString();
}
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -