Exemplo n.º 1
0
        public JsonResult SubmitOrder(OrderPostModel model, string payPwd)
        {
            model.CurrentUser            = base.CurrentUser;
            model.DistributionUserLinkId = base.GetDistributionUserLinkId();
            model.PlatformType           = base.PlatformType.GetHashCode();
            OrderReturnModel model2 = OrderApplication.SubmitOrder(model, payPwd);

            base.ClearDistributionUserLinkId();
            OrderApplication.AddVshopBuyNumber(model2.OrderIds);
            base.Session.Remove("OrderTag");
            return(base.Json(new { success = model2.Success, orderIds = model2.OrderIds, realTotalIsZero = model2.OrderTotal == 0M }));
        }
Exemplo n.º 2
0
        public JsonResult SubmitOrder(CommonModel.OrderPostModel model)
        {
            model.CurrentUser            = CurrentUser;
            model.DistributionUserLinkId = GetDistributionUserLinkId();
            model.PlatformType           = PlatformType.GetHashCode();

            var result = OrderApplication.SubmitOrder(model);

            ClearDistributionUserLinkId();   //清理分销cookie
            OrderApplication.AddVshopBuyNumber(result.OrderIds);
            Session.Remove("OrderTag");
            return(Json(new { success = result.Success, orderIds = result.OrderIds, realTotalIsZero = result.OrderTotal == 0 }));
        }
Exemplo n.º 3
0
        public JsonResult SubmitOrder(OrderPostModel model, string payPwd)
        {
            model.CurrentUser       = CurrentUser;
            model.PlatformType      = PlatformType.GetHashCode();
            model.IsShopbranchOrder = true;
            var result = OrderApplication.SubmitOrder(model, payPwd);

            OrderApplication.AddVshopBuyNumber(result.OrderIds);
            #region 处理虚拟订单项
            OrderApplication.AddVshopBuyNumber(result.OrderIds);
            if (model.ProductType == 1 && model.VirtualProductItems != null && model.VirtualProductItems.Count() > 0)
            {
                var orderId = result.OrderIds.FirstOrDefault();
                if (orderId > 0)
                {
                    var orderItemInfo = OrderApplication.GetOrderItemsByOrderId(orderId).FirstOrDefault();
                    if (orderItemInfo != null)
                    {
                        var list = model.VirtualProductItems.ToList().Where(a => !string.IsNullOrWhiteSpace(a.Content)).ToList();//过滤空项
                        list.ForEach(a =>
                        {
                            a.OrderId     = orderId;
                            a.OrderItemId = orderItemInfo.Id;
                            if (a.VirtualProductItemType == (sbyte)ProductInfo.VirtualProductItemType.Picture)
                            {
                                a.Content = MoveImages(a.Content, CurrentUser.Id);
                            }
                        });
                        if (list.Count > 0)
                        {
                            OrderApplication.AddVirtualOrderItemInfo(list);
                        }
                    }
                }
            }
            #endregion
            HttpContext.Session.Remove("OrderTag");
            return(Json <dynamic>(result.Success, data: new { orderIds = result.OrderIds, realTotalIsZero = result.OrderTotal == 0 }));
        }