⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myorderlist.aspx.cs

📁 易想商城系统
💻 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 myOrderList : 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(0x5D, 0x8F, 0xB2);
            }
            GridView1.DataBind();
        }
        #endregion
        #region Formant Str
        public string checkInv(object obj)
        {
            string reStr = string.Empty;
            int invNum = 0;
            if (YXShop.Common.WebUtility.isNumeric(obj))
            {
                invNum = Convert.ToInt32(obj);
            }
            if (invNum > 0)
            {
                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 = "√";
            }
            return reStr;
        }
        #endregion
        #region 客户信息查询
        protected string UserName(object UserID)
        {
            string str = "";
            if (!YXShop.Common.WebUtility.isNumeric(UserID))
            {
                return str;
            }
            YXShop.BLL.UserCommon ucBll = new YXShop.BLL.UserCommon();
            List<YXShop.Model.UserCommon> ucList = ucBll.GetListByColumn("UID", UserID);
            if (ucList.Count > 0)
            {
                str = ucList[0].UserName;
            }
            return str;
        }
        protected string UserReal(object UserID)
        {
            string str = "";
            if (!YXShop.Common.WebUtility.isNumeric(UserID))
            {
                return str;
            }
            YXShop.BLL.MemberInfo data = new YXShop.BLL.MemberInfo();
            List<YXShop.Model.MemberInfo> dataStr = data.GetListByColumn("uUserId", UserID);
            if (dataStr.Count > 0)
            {
                str = dataStr[0].cTrueName;
            }
            return str;
        }
        #endregion
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -