예제 #1
0
        public ActionResult OrderShare(string orderids, string source)
        {
            if (string.IsNullOrWhiteSpace(orderids))
            {
                throw new HimallException("预约单号不能为空!");
            }
            long orderId = 0L;
            IEnumerable <long> enumerable = orderids.Split(new char[] { ',' }).Select <string, long>(delegate(string e)
            {
                if (long.TryParse(e, out orderId))
                {
                    return(orderId);
                }
                return(0L);
            });

            if (MemberIntegralApplication.OrderIsShared(enumerable))
            {
                ViewBag.IsShared = true;
            }
            ViewBag.Source   = source;
            ViewBag.OrderIds = orderids;
            List <OrderDetailView> orderDetailViews = OrderApplication.GetOrderDetailViews(enumerable);

            return(base.View(orderDetailViews));
        }
예제 #2
0
        public ActionResult OrderShare(string orderids, string source)
        {
            if (string.IsNullOrWhiteSpace(orderids))
            {
                throw new MallException("订单号不能为空!");
            }
            long orderId = 0;
            var  ids     = orderids.Split(',').Select(e =>
            {
                if (long.TryParse(e, out orderId))
                {
                    return(orderId);
                }
                else
                {
                    return(0);
                }
            }
                                                      );

            if (MemberIntegralApplication.OrderIsShared(ids))
            {
                ViewBag.IsShared = true;
            }
            ViewBag.Source   = source;
            ViewBag.OrderIds = orderids;
            var orders = OrderApplication.GetOrderDetailViews(ids);

            return(View(orders));
        }
        public object GetOrderShareProduct(string orderids)
        {
            this.CheckUserLogin();
            if (string.IsNullOrWhiteSpace(orderids))
            {
                throw new HimallException("订单号不能为空!");
            }
            long orderId = 0L;

            return((object)this.Json(new
            {
                Success = true,
                OrderDetail = OrderApplication.GetOrderDetailViews(Enumerable.Select <string, long>((IEnumerable <string>)orderids.Split(','), (Func <string, long>)(e =>
                {
                    if (long.TryParse(e, out orderId))
                    {
                        return orderId;
                    }
                    return 0L;
                })))
            }));
        }
예제 #4
0
 public object GetOrderShareProduct(string orderids)
 {
     CheckUserLogin();
     if (string.IsNullOrWhiteSpace(orderids))
     {
         throw new MallException("订单号不能为空!");
     }
     long orderId = 0;
     var ids = orderids.Split(',').Select(e =>
     {
         if (long.TryParse(e, out orderId))
         {
             return orderId;
         }
         else
         {
             return 0;
         }
     }
     );
     var orders = OrderApplication.GetOrderDetailViews(ids);
     return new { success = true, OrderDetail = orders };
 }