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

📄 orderlist.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 System.Collections.Generic;
using YXShop.Common;
using YXShop.Web.Admin.Control;
using Shop.Web.UI;

namespace YXShop.Web.Admin.Orders
{
    public partial class orderList : System.Web.UI.Page
    {
        YXShop.BLL.Orders bll = new YXShop.BLL.Orders();
        YXShop.BLL.OrderInvoice bllInv = new YXShop.BLL.OrderInvoice();
        BasePage bp = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(YXShop.Web.Admin.Orders.orderList));
            if (!PowerTree.PowerPass.isPass("006001000", PowerTree.PowerPanel.PowerType.look))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有查看此页面的权限!", "../index.aspx");
            }
            this.PageNavigator1.OnPageChange += new PageChangeHandler(PageNavigator1_PageChange);
            if (Request.Form["Option"] != null && !Request.Form["Option"].Trim().Equals("")
    && Request.Form["ID"] != null && !Request.Form["ID"].Trim().Equals(""))
            {

                string types = Request.Form["Option"].Trim();
                if (types == "del")
                {
                    if (!PowerTree.PowerPass.isPass("006001003",PowerTree.PowerPanel.PowerType.del))
                    {
                        bp = new BasePage();
                        bp.PageError("对不起,你没有查看此页面的权限!", "../index.aspx");
                    }
                    else
                    {
                        string id = Request.Form["ID"].Trim();
                        del(id);
                    }
                }
                Response.End();
                return;
            }
            if (!IsPostBack)
            {
                StartLoad(1);
            }
        }
        #region 列表信息
        //获得列表
        protected void PageNavigator1_PageChange(object sender, int PageIndex)
        {
            StartLoad(PageIndex);
        }

        protected void StartLoad(int PageIndex)
        {
            int i = 0;
            int j = 0;
            List<YXShop.Model.Orders> data = bll.GetAll(PageIndex, 20, out i, out j);
            this.PageNavigator1.PageCount = j;
            this.PageNavigator1.PageIndex = PageIndex;
            this.PageNavigator1.RecordCount = i;
            OrderList.DataSource = data;                              //设置datalist数据源
            OrderList.DataBind();                                   //绑定数据源
        }
        protected void DataList1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
        }
        #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("UID", UserID);
            if (dataStr.Count > 0)
            {
                str = dataStr[0].cTrueName;
            }
            return str;
        }
        #endregion

        #region Formant Str

        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 checkInv(string OrderId)
        {
            YXShop.BLL.OrderInvoice datab = new YXShop.BLL.OrderInvoice();
            List<YXShop.Model.OrderInvoice> data = datab.GetListByColumn("OrderID", OrderId);
            if (data.Count > 0)
            {
                return "√";
            }
            return "<span style='color:red'>×</span>";
        }
        public string checkInvoice(string OrderId)
        {
            string reStr = string.Empty;
            YXShop.BLL.InvoiceItem databi = new YXShop.BLL.InvoiceItem();
            List<YXShop.Model.InvoiceItem> data = databi.GetListByColumn("OrderID", OrderId);
            if (data.Count > 0)
            {
                reStr = "√";

            }
            else
            {
                reStr = "<span style='color:red'>×</span>";
            }
            return reStr;
        }
        #endregion

        #region 已付款
        protected string Payment(string orderId)
        {
            YXShop.BLL.RemittanceInfo Remibll = new YXShop.BLL.RemittanceInfo();//银行支付
            YXShop.BLL.PaymentMoney paymbll = new YXShop.BLL.PaymentMoney();//现金支付
            YXShop.BLL.PrepayMoney prepbll = new YXShop.BLL.PrepayMoney();//预付款支付
            YXShop.Model.RemittanceInfo bankModel = Remibll.GetModel(orderId);
            YXShop.Model.PaymentMoney paymModel = paymbll.GetModel(orderId);
            YXShop.Model.PrepayMoney prepModel = prepbll.GetModel(orderId);
            decimal remiPrice = Convert.ToDecimal(bankModel != null ? bankModel.RemittanceMoney : 0);
            decimal paymPrice = Convert.ToDecimal(paymModel != null ? paymModel.GatheringMoney : 0);
            decimal prepPrice = Convert.ToDecimal(prepModel != null ? prepModel.PayoutMoney : 0);
            return (remiPrice + paymPrice + prepPrice).ToString();
        }

        #endregion
        #region 删除信息
        private void del(string sid)
        {
            string[] id = sid.Split(',');
            int ln = id.Length;
            int n = 0;
            for (int i = 0; i < id.Length; i++)
            {
                if (!id[i].Trim().Equals(""))
                {
                    try
                    {
                        bll.Delect(id[i]);
                        n++;
                    }
                    catch
                    {
                        continue;
                    }
                }
            }
            Response.Write(n + "%成功删除" + n + "条订单!");
        }
        #endregion

        protected void AddBtn_Click(object sender, EventArgs e)
        {
            Response.Redirect("OrderAdd.aspx", true);
        }
    }
}

⌨️ 快捷键说明

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