📄 ordercenter.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;
namespace YXShop.Web.Membercenter.Dynamic
{
public partial class orderCenter : System.Web.UI.Page
{
YXShop.BLL.Orders bll = new YXShop.BLL.Orders();
YXShop.BLL.OrderInvoice bllInv = new YXShop.BLL.OrderInvoice();
public PageSet ps;
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(YXShop.Web.Admin.Orders.orderList));
if (Session["MemberID"] == null)
{
Response.Redirect("../index.aspx", true);
}
else
{
if (string.IsNullOrEmpty(Session["MemberID"].ToString()))
{
Response.Redirect("../index.aspx", true);
}
}
if ((!IsPostBack) || (string.IsNullOrEmpty(Request["Event"])))
{
BindOrders();
}
}
#region Bind Data
private void BindOrders()
{
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.Orders> datas = bll.GetListByColumn("UserId", Session["MemberID"]);
GridView1.DataSource = datas;
ps = new PageSet(datas.Count, PageSet.PageSize, pageIndex);
if (ps.PageCount <= pageIndex + 1)
{
pageIndex = ps.PageCount - 1;
}
GridView1.PageSize = PageSet.PageSize;
GridView1.PageIndex = pageIndex;
if (datas.Count < 1)
{
GridView1.BackColor = System.Drawing.Color.White;
}
else
{
GridView1.BackColor = System.Drawing.Color.FromArgb(0xbe, 0xbe, 0xbe);
}
GridView1.DataBind();
}
#endregion
#region Formant Str
public string checkInv(object obj)
{
string reStr = string.Empty;
YXShop.BLL.InvoiceItem invoBll = new YXShop.BLL.InvoiceItem();
List<YXShop.Model.InvoiceItem> invoList = invoBll.GetListByColumn("OrderID", obj);
if (invoList != null && invoList.Count > 0)
{
reStr = "√";
}
else
{
reStr = "×";
}
return reStr;
}
public string checkOrderStatu(object obj)
{
string reStr = string.Empty;
Type orderStatu = typeof(YXShop.Common.StatuEnum.OrderStatu);
bool bl = YXShop.Common.WebUtility.isNumeric(obj);
if (bl)
{
reStr = Enum.GetName(orderStatu, obj);
}
return reStr;
}
public string checkPaymentStatu(object obj)
{
string reStr = string.Empty;
Type paymentStatu = typeof(YXShop.Common.StatuEnum.PaymentStatu);
bool bl = YXShop.Common.WebUtility.isNumeric(obj);
if (bl)
{
reStr = Enum.GetName(paymentStatu, obj);
}
return reStr;
}
public string checkOgisticsStatu(object obj)
{
string reStr = string.Empty;
Type ogisticsStatu = typeof(YXShop.Common.StatuEnum.OgisticsStatus);
bool bl = YXShop.Common.WebUtility.isNumeric(obj);
if (bl)
{
reStr = Enum.GetName(ogisticsStatu, obj);
}
return reStr;
}
public string checkInvoice(object obj)
{
string reStr = string.Empty;
List<YXShop.Model.OrderInvoice> model = bllInv.GetListByColumn("OrderID", obj);
if (model != null)
{
reStr = "√";
}
else
{
reStr = "×";
}
return reStr;
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -