Ejemplo n.º 1
0
        /// <summary>
        /// 礼品订单详情
        /// </summary>
        /// <returns></returns>
        public ActionResult OrderDetail(long id)
        {
            var order = _iGiftsOrderService.GetOrder(id, CurrentUser.Id);

            if (order == null)
            {
                throw new MallException("错误的参数");
            }
            var orderlist = new GiftOrderInfo[] { order };

            _iGiftsOrderService.OrderAddUserInfo(orderlist);
            order = orderlist.FirstOrDefault();
            var expressData = _iExpressService.GetExpressData(order.ExpressCompanyName, order.ShipOrderNumber);

            if (expressData.Success)
            {
                expressData.ExpressDataItems = expressData.ExpressDataItems.OrderByDescending(item => item.Time);//按时间逆序排列
            }
            MyGiftsOrderDetailModel result = new MyGiftsOrderDetailModel();

            result.OrderData   = order;
            result.OrderItems  = _iGiftsOrderService.GetOrderItemByOrder(id);
            result.ExpressData = expressData;
            return(View(result));
        }
Ejemplo n.º 2
0
        public JsonResult OrderList(string skey, GiftOrderInfo.GiftOrderStatus?status, int rows, int page)
        {
            GiftsOrderQuery query = new GiftsOrderQuery();

            query.skey     = skey;
            query.status   = status;
            query.PageSize = rows;
            query.PageNo   = page;
            var orderdata = _iGiftsOrderService.GetOrders(query);
            List <GiftOrderInfo> orderlist = orderdata.Models.ToList();

            _iGiftsOrderService.OrderAddUserInfo(orderlist);
            var datalist = orderlist.Select(d =>
            {
                var orditem = d.Himall_GiftOrderItem.FirstOrDefault();
                return(new GiftOrderPageModel
                {
                    Id = d.Id,
                    OrderStatus = d.OrderStatus,
                    UserId = d.UserId,
                    UserRemark = ClearHtmlString(d.UserRemark),
                    ShipTo = d.ShipTo,
                    CellPhone = d.CellPhone,
                    TopRegionId = d.TopRegionId,
                    RegionId = d.RegionId,
                    RegionFullName = d.RegionFullName,
                    Address = ClearHtmlString(d.Address),
                    ExpressCompanyName = d.ExpressCompanyName,
                    ShipOrderNumber = d.ShipOrderNumber,
                    ShippingDate = d.ShippingDate,
                    OrderDate = d.OrderDate,
                    FinishDate = d.FinishDate,
                    TotalIntegral = d.TotalIntegral,
                    CloseReason = ClearHtmlString(d.CloseReason),
                    FirstGiftId = orditem.GiftId,
                    FirstGiftName = ClearHtmlString(orditem.GiftName),
                    FirstGiftBuyQuantity = orditem.Quantity,
                    UserName = d.UserName
                });
            });
            var result = new { rows = datalist.ToList(), total = orderdata.Total };

            return(Json(result));
        }
Ejemplo n.º 3
0
        public JsonResult OrderList(string skey, GiftOrderInfo.GiftOrderStatus?status, int rows, int page)
        {
            GiftsOrderQuery giftsOrderQuery = new GiftsOrderQuery()
            {
                skey     = skey,
                status   = status,
                PageSize = rows,
                PageNo   = page
            };
            PageModel <GiftOrderInfo> orders = orderser.GetOrders(giftsOrderQuery);
            List <GiftOrderInfo>      list   = orders.Models.ToList();

            orderser.OrderAddUserInfo(list);
            IEnumerable <GiftOrderPageModel> giftOrderPageModels = list.Select <GiftOrderInfo, GiftOrderPageModel>((GiftOrderInfo d) => {
                GiftOrderItemInfo giftOrderItemInfo = d.ChemCloud_GiftOrderItem.FirstOrDefault();
                return(new GiftOrderPageModel()
                {
                    Id = d.Id,
                    OrderStatus = d.OrderStatus,
                    UserId = d.UserId,
                    UserRemark = ClearHtmlString(d.UserRemark),
                    ShipTo = d.ShipTo,
                    CellPhone = d.CellPhone,
                    TopRegionId = d.TopRegionId,
                    RegionId = d.RegionId,
                    RegionFullName = d.RegionFullName,
                    Address = ClearHtmlString(d.Address),
                    ExpressCompanyName = d.ExpressCompanyName,
                    ShipOrderNumber = d.ShipOrderNumber,
                    ShippingDate = d.ShippingDate,
                    OrderDate = d.OrderDate,
                    FinishDate = d.FinishDate,
                    TotalIntegral = d.TotalIntegral,
                    CloseReason = ClearHtmlString(d.CloseReason),
                    FirstGiftId = giftOrderItemInfo.GiftId,
                    FirstGiftName = ClearHtmlString(giftOrderItemInfo.GiftName),
                    FirstGiftBuyQuantity = giftOrderItemInfo.Quantity,
                    UserName = d.UserName
                });
            });
            var variable = new { rows = giftOrderPageModels.ToList(), total = orders.Total };

            return(Json(variable));
        }
Ejemplo n.º 4
0
        public ActionResult OrderList(string skey, GiftOrderInfo.GiftOrderStatus?status, int page = 1)
        {
            int             num             = 12;
            GiftsOrderQuery giftsOrderQuery = new GiftsOrderQuery()
            {
                skey = skey
            };

            if (status.HasValue && status.Value != 0)
            {
                giftsOrderQuery.status = status;
            }
            giftsOrderQuery.UserId   = new long?(base.CurrentUser.Id);
            giftsOrderQuery.PageSize = num;
            giftsOrderQuery.PageNo   = page;
            PageModel <GiftOrderInfo> orders = orderser.GetOrders(giftsOrderQuery);
            PagingInfo pagingInfo            = new PagingInfo()
            {
                CurrentPage  = page,
                ItemsPerPage = num,
                TotalItems   = orders.Total
            };
            PagingInfo           pagingInfo1 = pagingInfo;
            List <GiftOrderInfo> list        = orders.Models.ToList();

            if (list.Count > 0)
            {
                ViewBag.pageInfo = pagingInfo1;
                orderser.OrderAddUserInfo(list);
                List <GiftOrderInfo> giftOrderInfos = list.ToList();
                foreach (GiftOrderInfo giftOrderInfo in giftOrderInfos)
                {
                    giftOrderInfo.Address     = ClearHtmlString(giftOrderInfo.Address);
                    giftOrderInfo.CloseReason = ClearHtmlString(giftOrderInfo.CloseReason);
                    giftOrderInfo.UserRemark  = ClearHtmlString(giftOrderInfo.UserRemark);
                }
                return(View(giftOrderInfos));
            }
            else
            {
                return(RedirectToAction("Error", "UserIntegral"));
            }
        }
Ejemplo n.º 5
0
        public ActionResult OrderList(string skey, Mall.Entities.GiftOrderInfo.GiftOrderStatus?status, int page = 1)
        {
            int             rows  = 12;
            GiftsOrderQuery query = new GiftsOrderQuery();

            query.Skey = skey;
            if (status != null)
            {
                if ((int)status != 0)
                {
                    query.Status = status;
                }
            }
            query.UserId   = CurrentUser.Id;
            query.PageSize = rows;
            query.PageNo   = page;
            var orderdata = _iGiftsOrderService.GetOrders(query);
            var info      = new PagingInfo
            {
                CurrentPage  = page,
                ItemsPerPage = rows,
                TotalItems   = orderdata.Total
            };
            var orderlist = orderdata.Models;

            ViewBag.pageInfo = info;
            _iGiftsOrderService.OrderAddUserInfo(orderlist);
            var result = orderlist;

            foreach (var item in result)
            {
                item.Address     = ClearHtmlString(item.Address);
                item.CloseReason = ClearHtmlString(item.CloseReason);
                item.UserRemark  = ClearHtmlString(item.UserRemark);
            }
            ViewBag.OrderItems = _iGiftsOrderService.GetOrderItemByOrder(orderlist.Select(p => p.Id).ToList());
            return(View(result));
        }