Ejemplo n.º 1
0
        public ActionResult SubmiteByCart(string cartItemIds)
        {
            MobileOrderDetailConfirmModel mobileSubmiteByCart = OrderApplication.GetMobileSubmiteByCart(base.UserId, cartItemIds);

            ViewBag.InvoiceContext   = mobileSubmiteByCart.InvoiceContext;
            ViewBag.InvoiceTitle     = mobileSubmiteByCart.InvoiceTitle;
            ViewBag.IsCashOnDelivery = mobileSubmiteByCart.IsCashOnDelivery;
            ViewBag.address          = mobileSubmiteByCart.Address;
            ViewBag.ConfirmModel     = mobileSubmiteByCart;
            string str = Guid.NewGuid().ToString("N");

            ViewBag.OrderTag         = str;
            base.Session["OrderTag"] = str;
            this.InitOrderSubmitModel(mobileSubmiteByCart);
            ViewBag.IsOpenStore = (SiteSettingApplication.GetSiteSettings() != null) && SiteSettingApplication.GetSiteSettings().IsOpenStore;
            bool flag = false;

            if (mobileSubmiteByCart.products != null)
            {
                foreach (MobileShopCartItemModel model2 in mobileSubmiteByCart.products)
                {
                    if (model2.shopId > 0L)
                    {
                        ShopInfo shop = ShopApplication.GetShop(model2.shopId, false);
                        if (!(!shop.ProvideInvoice.HasValue ? true : !shop.ProvideInvoice.Value))
                        {
                            flag = true;
                        }
                    }
                }
            }
            ViewBag.ProvideInvoice = flag;
            return(base.View("submit"));
        }
Ejemplo n.º 2
0
        public object GetGroupOrderModel(string skuId, int count, long GroupActionId, long?GroupId = null)
        {
            this.CheckUserLogin();
            MobileOrderDetailConfirmModel detailConfirmModel = OrderApplication.SubmitByGroupId(this.CurrentUser.Id, skuId, count, GroupActionId, GroupId);

            if (detailConfirmModel.Address != null)
            {
                detailConfirmModel.Address.MemberInfo = new UserMemberInfo();
            }
            detailConfirmModel.IsOpenStore = SiteSettingApplication.GetSiteSettings() != null && SiteSettingApplication.GetSiteSettings().IsOpenStore;
            return((object)detailConfirmModel);
        }
Ejemplo n.º 3
0
        public object GetSubmitByCartModel(string cartItemIds = "")
        {
            this.CheckUserLogin();
            MobileOrderDetailConfirmModel mobileSubmiteByCart = OrderApplication.GetMobileSubmiteByCart(this.CurrentUserId, cartItemIds);

            if (mobileSubmiteByCart.shopBranchInfo == null)
            {
                throw new HimallException("获取门店信息失败,不可提交非门店商品");
            }
            ShopBranch shopBranchById = ShopBranchApplication.GetShopBranchById(mobileSubmiteByCart.shopBranchInfo.Id);
            object     obj1           = (object)new ExpandoObject();
            object     obj2;

            if (mobileSubmiteByCart.Address != null)
            {
                string str = mobileSubmiteByCart.Address.AddressDetail ?? "";
                var    fAnonymousType30 = new
                {
                    Id       = mobileSubmiteByCart.Address.Id,
                    ShipTo   = mobileSubmiteByCart.Address.ShipTo,
                    Phone    = mobileSubmiteByCart.Address.Phone,
                    Address  = mobileSubmiteByCart.Address.RegionFullName + " " + mobileSubmiteByCart.Address.Address + " " + str,
                    RegionId = mobileSubmiteByCart.Address.RegionId
                };
                obj2 = (object)fAnonymousType30;
            }
            else
            {
                obj2 = (object)null;
            }
            return((object)this.Json(new
            {
                Success = "true",
                Address = obj2,
                IsCashOnDelivery = mobileSubmiteByCart.IsCashOnDelivery,
                InvoiceContext = mobileSubmiteByCart.InvoiceContext,
                InvoiceTitle = OrderApplication.GetInvoiceTitles(this.CurrentUserId),
                products = mobileSubmiteByCart.products,
                integralPerMoney = mobileSubmiteByCart.integralPerMoney,
                userIntegrals = mobileSubmiteByCart.userIntegrals,
                TotalAmount = mobileSubmiteByCart.totalAmount,
                Freight = mobileSubmiteByCart.Freight,
                orderAmount = mobileSubmiteByCart.orderAmount,
                shopBranchInfo = shopBranchById,
                IsOpenStore = SiteSettingApplication.GetSiteSettings() != null && SiteSettingApplication.GetSiteSettings().IsOpenStore,
                capitalAmount = mobileSubmiteByCart.capitalAmount
            }));
        }
Ejemplo n.º 4
0
 private void InitOrderSubmitModel(MobileOrderDetailConfirmModel model)
 {
     if (model.Address != null)
     {
         ShopBranchQuery query = new ShopBranchQuery
         {
             Status = 0
         };
         query.AddressPath = RegionApplication.GetRegion((long)model.Address.RegionId, Region.RegionLevel.City).GetIdPath(",");
         foreach (MobileShopCartItemModel model2 in model.products)
         {
             query.ShopId           = model2.shopId;
             query.ProductIds       = (from p in model2.CartItemModels select p.id).ToArray <long>();
             model2.ExistShopBranch = ShopBranchApplication.Exists(query);
         }
     }
 }
Ejemplo n.º 5
0
        private void InitOrderSubmitModel(MobileOrderDetailConfirmModel model)
        {
            if (model.Address != null)
            {
                var query = new CommonModel.ShopBranchQuery();
                query.Status = CommonModel.ShopBranchStatus.Normal;

                var region = RegionApplication.GetRegion(model.Address.RegionId, CommonModel.Region.RegionLevel.City);
                query.AddressPath = region.GetIdPath();

                foreach (var item in model.products)
                {
                    query.ShopId         = item.shopId;
                    query.ProductIds     = item.CartItemModels.Select(p => p.id).ToArray();
                    item.ExistShopBranch = ShopBranchApplication.Exists(query);
                }
            }
        }
Ejemplo n.º 6
0
        public ActionResult SubmitByProductId(string skuIds, string counts, long?regionId, string collpids = null)
        {
            ViewBag.Logo   = base.CurrentSiteSetting.Logo;
            ViewBag.Member = base.CurrentUser;
            MobileOrderDetailConfirmModel model = OrderApplication.GetMobileCollocationBuy(base.UserId, skuIds, counts, regionId, collpids);

            ViewBag.collpids         = collpids;
            ViewBag.skuIds           = skuIds;
            ViewBag.counts           = counts;
            ViewBag.InvoiceContext   = model.InvoiceContext;
            ViewBag.InvoiceTitle     = model.InvoiceTitle;
            ViewBag.IsCashOnDelivery = model.IsCashOnDelivery;
            ViewBag.address          = model.Address;
            ViewBag.ConfirmModel     = model;
            ViewBag.Islimit          = false;
            string str = Guid.NewGuid().ToString("N");

            ViewBag.OrderTag         = str;
            base.Session["OrderTag"] = str;
            this.InitOrderSubmitModel(model);
            ViewBag.IsOpenStore = (SiteSettingApplication.GetSiteSettings() != null) && SiteSettingApplication.GetSiteSettings().IsOpenStore;
            bool flag = false;

            if (model.products != null)
            {
                foreach (MobileShopCartItemModel model2 in model.products)
                {
                    if (model2.shopId > 0L)
                    {
                        ShopInfo shop = ShopApplication.GetShop(model2.shopId, false);
                        if (!(!shop.ProvideInvoice.HasValue ? true : !shop.ProvideInvoice.Value))
                        {
                            flag = true;
                        }
                    }
                }
            }
            ViewBag.ProvideInvoice = flag;
            return(base.View("Submit"));
        }
Ejemplo n.º 7
0
        public ActionResult SubmitGroup(string skuId, int count, long GroupActionId, long?GroupId = new long?())
        {
            MobileOrderDetailConfirmModel model = OrderApplication.SubmitByGroupId(base.UserId, skuId, count, GroupActionId, GroupId);

            ViewBag.ConfirmModel     = model;
            ViewBag.GroupActionId    = GroupActionId;
            ViewBag.GroupId          = GroupId;
            ViewBag.IsCashOnDelivery = model.IsCashOnDelivery;
            ViewBag.address          = model.Address;
            ViewBag.InvoiceContext   = model.InvoiceContext;
            ViewBag.InvoiceTitle     = model.InvoiceTitle;
            string str = Guid.NewGuid().ToString("N");

            ViewBag.OrderTag         = str;
            base.Session["OrderTag"] = str;
            ViewBag.IsFightGroup     = true;
            this.InitOrderSubmitModel(model);
            ViewBag.IsOpenStore = (SiteSettingApplication.GetSiteSettings() != null) && SiteSettingApplication.GetSiteSettings().IsOpenStore;
            bool flag = false;

            if (model.products != null)
            {
                foreach (MobileShopCartItemModel model2 in model.products)
                {
                    if (model2.shopId > 0L)
                    {
                        ShopInfo shop = ShopApplication.GetShop(model2.shopId, false);
                        if (!(!shop.ProvideInvoice.HasValue ? true : !shop.ProvideInvoice.Value))
                        {
                            flag = true;
                        }
                    }
                }
            }
            ViewBag.ProvideInvoice = flag;
            return(base.View("submit"));
        }