Пример #1
0
        protected override void PageLoad()
        {
            base.PageLoad();
            //检查待付款订单是否超时失效,超时则更新为失效状态
            OrderBLL.CheckOrderPayTime();
            //订单自动收货
            OrderBLL.CheckOrderRecieveTimeProg();
            OrderSearchInfo orderSearch = new OrderSearchInfo();

            orderSearch.OrderNumber = RequestHelper.GetQueryString <string>("OrderNumber");
            orderStatus             = RequestHelper.GetQueryString <int>("OrderStatus") <= 0?2: RequestHelper.GetQueryString <int>("OrderStatus");
            //如果查找已删除订单
            if (orderStatus == (int)Entity.OrderStatus.HasDelete)
            {
                orderSearch.IsDelete = (int)BoolType.True;//已删除
            }
            else
            {
                orderSearch.OrderStatus = orderStatus;
                orderSearch.IsDelete    = (int)BoolType.False;//未删除
            }
            orderSearch.Consignee    = RequestHelper.GetQueryString <string>("Consignee");
            orderSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
            orderSearch.EndAddDate   = RequestHelper.GetQueryString <DateTime>("EndAddDate");

            orderList = OrderBLL.SearchList(1, pageSize, orderSearch, ref Count);

            if (orderStatus == 2 || orderStatus == 4)
            {
                topNav = 0;
            }
        }
Пример #2
0
        protected override void PageLoad()
        {
            base.PageLoad();
            //检查待付款订单是否超时失效,超时则更新为失效状态
            OrderBLL.CheckOrderPayTime();
            //订单自动收货
            OrderBLL.CheckOrderRecieveTimeProg();

            OrderSearchInfo orderSearch = new OrderSearchInfo();

            //orderDate =string.IsNullOrEmpty(RequestHelper.GetQueryString<string>("orderDate"))?orderDate: RequestHelper.GetQueryString<DateTime>("orderDate")<=DateTime.MinValue?orderDate: RequestHelper.GetQueryString<DateTime>("orderDate");
            searchKey               = RequestHelper.GetQueryString <string>("searchKey");
            orderPeriod             = RequestHelper.GetQueryString <int>("orderPeriod");
            orderStatus             = RequestHelper.GetQueryString <int>("OrderStatus");
            orderSearch.OrderPeriod = orderPeriod;
            orderSearch.SearchKey   = searchKey;
            //orderSearch.OrderDate = orderDate;
            //如果查找已删除订单
            if (orderStatus == (int)Entity.OrderStatus.HasDelete)
            {
                orderSearch.IsDelete = (int)BoolType.True;//已删除
            }
            else
            {
                orderSearch.OrderStatus = orderStatus;
                orderSearch.IsDelete    = (int)BoolType.False;//未删除
            }
            orderSearch.Consignee    = RequestHelper.GetQueryString <string>("Consignee");
            orderSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
            orderSearch.EndAddDate   = RequestHelper.GetQueryString <DateTime>("EndAddDate");

            orderList = OrderBLL.SearchList(1, pageSize, orderSearch, ref Count);

            topNav = 1;
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //检查待付款订单是否超时失效,超时则更新为失效状态
                OrderBLL.CheckOrderPayTime();
                //订单自动收货
                OrderBLL.CheckOrderRecieveTimeProg();

                CheckAdminPower("ReadOrder", PowerCheckType.Single);

                OrderNumber.Text  = RequestHelper.GetQueryString <string>("OrderNumber");
                Consignee.Text    = RequestHelper.GetQueryString <string>("Consignee");
                StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");
                SelfPick.Text     = RequestHelper.GetQueryString <string>("SelfPick");
                OrderSearchInfo orderSearch = new OrderSearchInfo();
                orderSearch.OrderNumber = RequestHelper.GetQueryString <string>("OrderNumber");

                orderSearch.OrderStatus = intOrderStatus;
                orderSearch.IsDelete    = (int)BoolType.False;//未删除

                orderSearch.Consignee    = RequestHelper.GetQueryString <string>("Consignee");
                orderSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                orderSearch.EndAddDate   = RequestHelper.GetQueryString <DateTime>("EndAddDate");
                orderSearch.SelfPick     = RequestHelper.GetQueryString <int>("SelfPick");
                PageSize           = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]);
                AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString();
                var orderList = OrderBLL.SearchList(CurrentPage, PageSize, orderSearch, ref Count);

                BindControl(orderList, RecordList, MyPager);
            }
        }
Пример #4
0
        protected override void PageLoad()
        {
            base.PageLoad();
            //检查用户的待付款订单是否超时失效,超时则更新为失效状态
            OrderBLL.CheckOrderPayTime(base.UserId);
            type = RequestHelper.GetQueryString <string>("type");

            topNav = 7;

            string keywords    = RequestHelper.GetQueryString <string>("keywords");
            int    currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int             pageSize    = 10;
            int             count       = 0;
            OrderSearchInfo orderSearch = new OrderSearchInfo();

            orderSearch.UserId   = base.UserId;
            orderSearch.IsDelete = 0;
            if (!string.IsNullOrEmpty(keywords))
            {
                orderSearch.OrderNumber = keywords;
            }
            if (!string.IsNullOrEmpty(type))
            {
                int tt = 0;
                switch (type)
                {
                case "2": tt = 2; break;

                case "3": tt = 4; break;

                case "4": tt = 5; break;

                case "1": tt = 1; break;
                }
                orderSearch.OrderStatus = tt;
            }

            orderList = OrderBLL.SearchList(currentPage, pageSize, orderSearch, ref count);

            commonPagerClass.Init(currentPage, pageSize, count, !string.IsNullOrEmpty(isMobile));
            #region 对应状态个数
            arrT[0] = OrderBLL.SearchList(new OrderSearchInfo {
                UserId = base.UserId, IsDelete = 0
            }).Count;
            orderSearch.OrderStatus = 2;
            arrT[1] = OrderBLL.SearchList(orderSearch).Count;
            orderSearch.OrderStatus = 1;
            arrT[2] = OrderBLL.SearchList(orderSearch).Count;
            orderSearch.OrderStatus = 5;
            arrT[3] = OrderBLL.SearchList(orderSearch).Count;
            #endregion
        }
Пример #5
0
        protected bool isPL            = true;//是否已评论

        protected override void PageLoad()
        {
            base.PageLoad();
            //检查用户的待付款订单是否超时失效,超时则更新为失效状态
            OrderBLL.CheckOrderPayTime(base.UserId);
            int orderId = RequestHelper.GetQueryString <int>("id");

            userGradeName = UserGradeBLL.Read(base.GradeID).Name;


            order = OrderBLL.Read(orderId, base.UserId);


            if (order.Id <= 0)
            {
                ScriptHelper.AlertFront("订单不存在", "/user/index.html");
            }
            //礼品
            if (order.GiftId > 0)
            {
                gift = FavorableActivityGiftBLL.Read(order.GiftId);
            }
            orderDetailList = OrderDetailBLL.ReadList(orderId);
            int[] productIds = orderDetailList.Select(k => k.ProductId).ToArray();
            if (productIds.Length > 0)
            {
                int count = 0;
                productList = ProductBLL.SearchList(1, productIds.Length, new ProductSearchInfo {
                    InProductId = string.Join(",", productIds)
                }, ref count);
            }

            #region 判断是否已评论
            List <ProductCommentInfo>[] listPinfoArr = new List <ProductCommentInfo> [productList.Count];
            int pi = 0;
            foreach (ProductInfo item in productList)
            {
                ProductCommentSearchInfo psi = new ProductCommentSearchInfo();
                psi.ProductId    = item.Id;
                psi.UserId       = base.UserId;
                psi.OrderID      = orderId;
                listPinfoArr[pi] = ProductCommentBLL.SearchProductCommentList(psi);
                if (listPinfoArr[pi].Count <= 0)
                {
                    isPL = false;
                }
            }
            #endregion
            Title = "我的订单";
        }
Пример #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (RequestHelper.GetQueryString <string>("Action") == "GeetestValidate")
     {
         GeetestValidate();
     }
     if (!IsPostBack)
     {
         if (RequestHelper.UserAgent())
         {
             Response.Redirect("/mobileadmin/Login.html");
         }
         //检查待付款订单是否超时失效,超时则更新为失效状态
         OrderBLL.CheckOrderPayTime();
     }
 }
Пример #7
0
        public ActionResult Index()
        {
            int[] arrT = new int[5];
            //检查用户的待付款订单是否超时失效,超时则更新为失效状态
            OrderBLL.CheckOrderPayTime(user.Id);
            //订单自动收货
            OrderBLL.CheckOrderRecieveTimeProg(user.Id);

            OrderSearchInfo orderSearch = new OrderSearchInfo();

            orderSearch.OrderStatus = (int)(OrderStatus.WaitPay);
            orderSearch.UserId      = uid;
            orderSearch.IsDelete    = 0;
            arrT[0] = OrderBLL.SearchList(orderSearch).Count;
            orderSearch.OrderStatus = (int)(OrderStatus.WaitCheck);
            orderSearch.UserId      = uid;
            orderSearch.IsDelete    = 0;
            //待审核
            var orderList = OrderBLL.SearchList(orderSearch);

            arrT[1] = orderList.Count;
            #region 待分享
            var list1     = orderList.Where(k => k.IsActivity == (int)OrderKind.GroupBuy && k.FavorableActivityId > 0);
            var groupIds  = list1.Select(k => k.FavorableActivityId).ToArray();
            var groupList = GroupBuyBLL.ReadList(groupIds).Where(k => k.StartTime <= DateTime.Now && k.EndTime >= DateTime.Now && k.Quantity > k.SignCount);
            var ids       = groupList.Select(k => k.Id);
            var list2     = list1.Where(k => ids.Contains(k.FavorableActivityId));
            arrT[4] = list2.Count();
            #endregion

            orderSearch.OrderStatus = (int)(OrderStatus.HasShipping);
            orderSearch.UserId      = uid;
            orderSearch.IsDelete    = 0;
            arrT[2] = OrderBLL.SearchList(orderSearch).Count;
            orderSearch.OrderStatus = (int)(OrderStatus.ReceiveShipping);
            orderSearch.UserId      = uid;
            orderSearch.IsDelete    = 0;
            arrT[3] = OrderBLL.SearchList(orderSearch).Count;
            //是否填写手机号
            bool hasMobile = !string.IsNullOrEmpty(user.Mobile.Trim());
            #region 生日前后5天登录会员中心,自动发放本年度生日礼券。( 是否获取生日优惠券,本年生日前后5天出现提示)
            //判断是否能够获取本年度生日礼券
            bool     canGetBirthdayCoupon = true;
            DateTime birthday             = DateTime.MinValue;
            //如果用户已填写生日,则在生日前后5天提示领取生日礼券
            if (DateTime.TryParse(user.Birthday, out birthday) && (birthday.AddDays(-5).Month == DateTime.Now.Month && birthday.AddDays(-5).Day <= DateTime.Now.Day) && (birthday.AddDays(5).Month == DateTime.Now.Month && birthday.AddDays(5).Day >= DateTime.Now.Day))
            {
                int count      = 0;
                var couponlist = CouponBLL.SearchList(1, 1, new CouponSearchInfo {
                    Type = (int)CouponKind.BirthdayGet, CanUse = 1
                }, ref count);
                //如果有生日礼券活动进行中
                if (couponlist.Count > 0)
                {
                    ////如果本年度已获取,则不能再获取
                    //if (user.HasBirthdayCoupon != 0 && user.GetBirthdayCouponDate.Year == DateTime.Now.Year) canGetBirthdayCoupon = false;
                    #region 自动发放,每年度限领1次
                    if (user.HasBirthdayCoupon == 0 || (user.HasBirthdayCoupon != 0 && user.GetBirthdayCouponDate.Year != DateTime.Now.Year))
                    {
                        UserCouponInfo userCoupon = UserCouponBLL.ReadLast(couponlist[0].Id);
                        if (UserCouponBLL.UniqueUserCatch(user.Id, couponlist[0].Id))
                        {
                            int startNumber = 0;
                            if (userCoupon.Id > 0)
                            {
                                string tempNumber = userCoupon.Number.Substring(3, 5);
                                while (tempNumber.Substring(0, 1) == "0")
                                {
                                    tempNumber = tempNumber.Substring(1);
                                }
                                startNumber = Convert.ToInt32(tempNumber);
                            }
                            startNumber++;
                            int cpid = UserCouponBLL.Add(new UserCouponInfo
                            {
                                UserId   = user.Id,
                                UserName = user.UserName,
                                CouponId = couponlist[0].Id,
                                GetType  = (int)CouponType.BirthdayGet,
                                Number   = ShopCommon.CreateCouponNo(couponlist[0].Id, startNumber),
                                Password = ShopCommon.CreateCouponPassword(startNumber),
                                IsUse    = (int)BoolType.False,
                                OrderId  = 0
                            });
                            //领取成功改变user表标识
                            if (cpid > 0)
                            {
                                Dictionary <string, object> dict = new Dictionary <string, object>();
                                dict.Add("[HasBirthdayCoupon]", 1);
                                dict.Add("[GetBirthdayCouponDate]", DateTime.Now);
                                UserBLL.UpdatePart("[usr]", dict, user.Id);
                                //user对应的未使用优惠券数量加1
                                user.CouPonLeft++;
                            }
                        }
                    }
                    #endregion
                }
                else
                {
                    //如果商家后台没有设置正在进行中的会员生日券,则不能获取
                    canGetBirthdayCoupon = false;
                }
            }
            else
            {
                canGetBirthdayCoupon = false;
            }
            #endregion
            //计算是否
            return(Json(new { ordercount = arrT, hasmobile = hasMobile, usergrade = userGradeInfo, cangetbirthdaycoupon = canGetBirthdayCoupon, couponleft = user.CouPonLeft, pointleft = user.PointLeft }, JsonRequestBehavior.AllowGet));
        }
Пример #8
0
        protected override void PageLoad()
        {
            base.PageLoad();
            //检查用户的待付款订单是否超时失效,超时则更新为失效状态
            OrderBLL.CheckOrderPayTime(base.UserId);
            type     = RequestHelper.GetQueryString <string>("type");
            cartList = CartBLL.ReadList(base.UserId);
            topNav   = 7;
            keywords = RequestHelper.GetQueryString <string>("keywords");
            int currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int             pageSize    = 10;
            int             count       = 0;
            OrderSearchInfo orderSearch = new OrderSearchInfo();

            orderSearch.UserId   = base.UserId;
            orderSearch.IsDelete = 0;
            if (!string.IsNullOrEmpty(keywords))
            {
                orderSearch.OrderNumber = keywords;
            }
            if (!string.IsNullOrEmpty(type))
            {
                int tt = 0;
                switch (type)
                {
                case "1": tt = (int)OrderStatus.WaitPay; break;

                case "2": tt = (int)OrderStatus.WaitCheck; break;

                case "3": tt = (int)OrderStatus.Shipping; break;

                case "4": tt = (int)OrderStatus.HasShipping; break;

                case "5": tt = (int)OrderStatus.NoEffect; break;
                }
                orderSearch.OrderStatus = tt;
            }

            orderList = OrderBLL.SearchList(currentPage, pageSize, orderSearch, ref count);
            //commonPagerClass.CurrentPage = currentPage;
            //commonPagerClass.PageSize = pageSize;
            //commonPagerClass.Count = count;
            //commonPagerClass.FirstPage = "<<首页";
            //commonPagerClass.PreviewPage = "<<上一页";
            //commonPagerClass.NextPage = "下一页>>";
            //commonPagerClass.LastPage = "末页>>";
            //commonPagerClass.ListType = false;
            //commonPagerClass.DisCount = false;
            //commonPagerClass.PrenextType = true;
            commonPagerClass.Init(currentPage, pageSize, count, !string.IsNullOrEmpty(isMobile));

            proListHot = ProductBLL.SearchList(1, 12, new ProductSearchInfo {
                IsHot = 1,
            }, ref count);
            #region 对应状态个数
            //OrderSearchInfo orderSearch1 = new OrderSearchInfo();
            //orderSearch1.UserId = base.UserId;
            //if (!string.IsNullOrEmpty(keywords))
            //{
            //    orderSearch1.OrderNumber = keywords;
            //}
            arrT[0] = OrderBLL.SearchList(currentPage, pageSize, new OrderSearchInfo {
                UserId = base.UserId, IsDelete = 0
            }, ref count).Count;
            orderSearch.OrderStatus = (int)(OrderStatus.WaitPay);
            arrT[1] = OrderBLL.SearchList(currentPage, pageSize, orderSearch, ref count).Count;
            orderSearch.OrderStatus = (int)(OrderStatus.Shipping);
            arrT[2] = OrderBLL.SearchList(currentPage, pageSize, orderSearch, ref count).Count;
            orderSearch.OrderStatus = (int)(OrderStatus.HasShipping);
            arrT[3] = OrderBLL.SearchList(currentPage, pageSize, orderSearch, ref count).Count;
            orderSearch.OrderStatus = (int)(OrderStatus.WaitCheck);
            arrT[4] = OrderBLL.SearchList(currentPage, pageSize, orderSearch, ref count).Count;
            orderSearch.OrderStatus = (int)(OrderStatus.NoEffect);
            arrT[5] = OrderBLL.SearchList(currentPage, pageSize, orderSearch, ref count).Count;
            #endregion
        }
Пример #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            { //检查待付款订单是否超时失效,超时则更新为失效状态
                OrderBLL.CheckOrderPayTime();
                int orderId = RequestHelper.GetQueryString <int>("Id");
                sendPoint = OrderBLL.ReadOrderSendPoint(orderId);
                if (orderId != int.MinValue)
                {
                    CheckAdminPower("ReadOrder", PowerCheckType.Single);
                    order          = OrderBLL.Read(orderId);
                    order.UserName = System.Web.HttpUtility.UrlDecode(order.UserName, System.Text.Encoding.UTF8);
                    int isCod = PayPlugins.ReadPayPlugins(order.PayKey).IsCod;
                    if ((order.OrderStatus == (int)OrderStatus.WaitPay || order.OrderStatus == (int)OrderStatus.WaitCheck && isCod == (int)BoolType.True) && order.IsActivity == (int)BoolType.False)
                    {
                        canEdit = true;
                    }
                    orderActionList = OrderActionBLL.ReadList(orderId);
                    ShowButton(order);

                    #region 获取快递信息
                    if (order.OrderStatus == (int)OrderStatus.HasShipping)
                    {
                        ShippingInfo tempShipping = ShippingBLL.Read(order.ShippingId);

                        string show = RequestHelper.GetQueryString <string>("show");

                        //string apiurl = "http://api.kuaidi100.com/api?id=2815b2d431fdfd26&com=" + typeCom + "&nu=" + nu + "&show=" + show + "&muti=1&order=asc";
                        string apiurl = "http://www.kuaidi100.com/applyurl?key=2815b2d431fdfd26&com=" + tempShipping.ShippingCode + "&nu=" + order.ShippingNumber + "&show=" + show + "&muti=1&order=desc";
                        //Response.Write (apiurl);
                        WebRequest   request  = WebRequest.Create(@apiurl);
                        WebResponse  response = request.GetResponse();
                        Stream       stream   = response.GetResponseStream();
                        Encoding     encode   = Encoding.UTF8;
                        StreamReader reader   = new StreamReader(stream, encode);

                        shippingLink = reader.ReadToEnd();
                    }
                    #endregion

                    //正在处理中的退款订单或商品
                    orderRefundList = OrderRefundBLL.ReadListValid(orderId);
                    //有正在处理中的退款订单或商品,禁用功能按钮
                    if (orderRefundList.Count(k => !OrderRefundBLL.HasReturn(k.Status)) > 0)
                    {
                        divOperate.Visible = false;
                        divNotice.Visible  = true;
                        lblNotice.Text     = "该订单有正在处理中的退款订单或商品...";
                    }
                }
                //如果付款操作,发送signalr消息
                if (RequestHelper.GetQueryString <int>("paysuccess") == 1)
                {
                    IHubContext chat = GlobalHost.ConnectionManager.GetHubContext <PushHub>();
                    chat.Clients.All.sendMessage(1);
                }
            }

            //不支持退货和退款操作,如果要退货退款,请线下操作
            ReturnButton.Visible = false;
        }
Пример #10
0
        protected override void PageLoad()
        {
            base.PageLoad();
            //检查用户的待付款订单是否超时失效,超时则更新为失效状态
            OrderBLL.CheckOrderPayTime(base.UserId);
            //订单自动收货
            OrderBLL.CheckOrderRecieveTimeProg(base.UserId);
            //cartList = CartBLL.ReadList(base.UserId);
            topNav = 7;

            string keywords = RequestHelper.GetQueryString <string>("keywords");

            int             count       = 0;
            OrderSearchInfo orderSearch = new OrderSearchInfo();

            orderSearch.UserId   = base.UserId;
            orderSearch.IsDelete = 0;
            if (!string.IsNullOrEmpty(keywords))
            {
                orderSearch.OrderNumber = keywords;
            }


            orderList = OrderBLL.SearchList(1, 5, orderSearch, ref count);

            //commonPagerClass.Init(currentPage, pageSize, count, !string.IsNullOrEmpty(isMobile));
            //热销商品
            proListHot = ProductBLL.SearchList(1, 8, new ProductSearchInfo {
                IsHot = 1, IsSale = 1, IsDelete = 0
            }, ref count);

            #region 对应状态个数

            arrT[0] = OrderBLL.SearchList(new OrderSearchInfo {
                UserId = base.UserId, IsDelete = 0
            }).Count;
            orderSearch.OrderStatus = (int)(OrderStatus.WaitPay);
            orderSearch.UserId      = base.UserId; orderSearch.IsDelete = 0;
            arrT[1] = OrderBLL.SearchList(orderSearch).Count;
            orderSearch.OrderStatus = (int)(OrderStatus.Shipping);
            orderSearch.UserId      = base.UserId; orderSearch.IsDelete = 0;
            arrT[2] = OrderBLL.SearchList(orderSearch).Count;
            orderSearch.OrderStatus = (int)(OrderStatus.HasShipping);
            orderSearch.UserId      = base.UserId; orderSearch.IsDelete = 0;
            arrT[3] = OrderBLL.SearchList(orderSearch).Count;
            orderSearch.OrderStatus = (int)(OrderStatus.WaitCheck);
            orderSearch.UserId      = base.UserId; orderSearch.IsDelete = 0;
            arrT[4] = OrderBLL.SearchList(orderSearch).Count;
            orderSearch.OrderStatus = (int)(OrderStatus.NoEffect);
            orderSearch.UserId      = base.UserId; orderSearch.IsDelete = 0;
            arrT[5] = OrderBLL.SearchList(orderSearch).Count;
            #endregion

            #region 浏览过的商品
            strHistoryProduct = Server.UrlDecode(CookiesHelper.ReadCookieValue("HistoryProduct"));
            if (strHistoryProduct.StartsWith(","))
            {
                strHistoryProduct = strHistoryProduct.Substring(1);
            }
            if (strHistoryProduct.EndsWith(","))
            {
                strHistoryProduct = strHistoryProduct.Substring(0, strHistoryProduct.Length - 1);
            }
            if (!string.IsNullOrEmpty(strHistoryProduct))
            {
                proHistoryList = ProductBLL.SearchList(1, 12, new ProductSearchInfo {
                    IsSale = 1, InProductId = strHistoryProduct, IsDelete = 0
                }, ref count);
            }
            #endregion
            #region 收藏的商品
            productCollectList = ProductCollectBLL.ReadListByUserId(base.UserId);
            string strProductID = string.Empty;
            foreach (ProductCollectInfo productCollect in productCollectList)
            {
                if (strProductID == string.Empty)
                {
                    strProductID = productCollect.ProductId.ToString();
                }
                else
                {
                    strProductID += "," + productCollect.ProductId.ToString();
                }
            }

            if (!string.IsNullOrEmpty(strProductID))
            {
                productList = ProductBLL.SearchList(1, 8, new ProductSearchInfo {
                    InProductId = strProductID, IsSale = 1, IsDelete = 0
                }, ref count);
            }
            #endregion
        }
Пример #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //检查待付款订单是否超时失效,超时则更新为失效状态
                OrderBLL.CheckOrderPayTime();
                //订单自动收货
                OrderBLL.CheckOrderRecieveTimeProg();

                CheckAdminPower("ReadOrder", PowerCheckType.Single);

                OrderNumber.Text  = RequestHelper.GetQueryString <string>("OrderNumber");
                OrderStatus.Text  = RequestHelper.GetQueryString <string>("OrderStatus");
                Consignee.Text    = RequestHelper.GetQueryString <string>("Consignee");
                StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");
                SelfPick.Text     = RequestHelper.GetQueryString <string>("SelfPick");
                OrderSearchInfo orderSearch = new OrderSearchInfo();
                orderSearch.OrderNumber = RequestHelper.GetQueryString <string>("OrderNumber");
                intOrderStatus          = RequestHelper.GetQueryString <int>("OrderStatus");

                //如果查找已删除订单
                if (intOrderStatus == (int)Entity.OrderStatus.HasDelete)
                {
                    orderSearch.IsDelete = (int)BoolType.True;//已删除
                }
                else
                {
                    orderSearch.OrderStatus = intOrderStatus;
                    orderSearch.IsDelete    = (int)BoolType.False;//未删除
                }
                orderSearch.Consignee    = RequestHelper.GetQueryString <string>("Consignee");
                orderSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                orderSearch.EndAddDate   = RequestHelper.GetQueryString <DateTime>("EndAddDate");
                orderSearch.SelfPick     = RequestHelper.GetQueryString <int>("SelfPick");
                PageSize           = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]);
                AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString();
                var orderList = OrderBLL.SearchList(CurrentPage, PageSize, orderSearch, ref Count);

                //取得订单最后一次操作的时间
                var orderActinList = OrderActionBLL.ReadListLastDate(orderList.Select(k => k.Id).ToArray());
                foreach (var order in orderList)
                {
                    var orderAction = orderActinList.FirstOrDefault(k => k.OrderId == order.Id) ?? new OrderActionInfo();
                    //此处使用InvoiceTitle字段来临时存储
                    order.InvoiceTitle = orderAction.OrderId > 0 ? orderAction.Date.ToString() : "";
                }
                BindControl(orderList, RecordList, MyPager);
                #region  除订单
                if (RequestHelper.GetQueryString <string>("Action") == "delete")
                {
                    CheckAdminPower("DeleteOrder", PowerCheckType.Single);
                    int orderId = RequestHelper.GetQueryString <int>("orderId");
                    if (orderId > 0)
                    {
                        OrderInfo tmpOrder = OrderBLL.Read(orderId);
                        if (tmpOrder.OrderStatus == (int)JWShop.Entity.OrderStatus.WaitPay)
                        {//待付款直接删除退还积分库存
                            #region 退还积分
                            if (tmpOrder.Point > 0)
                            {
                                var accountRecord = new UserAccountRecordInfo
                                {
                                    RecordType = (int)AccountRecordType.Point,
                                    Money      = 0,
                                    Point      = tmpOrder.Point,
                                    Date       = DateTime.Now,
                                    IP         = ClientHelper.IP,
                                    Note       = "取消订单:" + tmpOrder.OrderNumber + ",退回用户积分",
                                    UserId     = tmpOrder.UserId,
                                    UserName   = tmpOrder.UserName,
                                };
                                UserAccountRecordBLL.Add(accountRecord);
                            }
                            #endregion
                            //更新商品库存数量
                            ProductBLL.ChangeOrderCountByOrder(tmpOrder.Id, ChangeAction.Minus);
                            OrderBLL.Delete(orderId);
                            AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecordCompletely"), ShopLanguage.ReadLanguage("Order"), orderId);
                        }
                        else
                        { //已付款逻辑删除可恢复
                            if (tmpOrder.IsDelete == (int)BoolType.False)
                            {
                                tmpOrder.IsDelete = (int)BoolType.True;
                                OrderBLL.Update(tmpOrder);
                                AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("Order"), orderId);
                            }
                        }
                    }

                    ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), Request.UrlReferrer.ToString());
                }
                #endregion
            }
        }