Esempio n. 1
0
        public JsonResult OnSaleProduct(long shopbranchId, string pids)
        {
            if (string.IsNullOrWhiteSpace(pids))
            {
                return(Json(new { success = false, msg = "参数异常" }));
            }
            var ids = ConvertToIEnumerable(pids);

            if (!ShopBranchApplication.CanOnSaleProduct(ids))
            {
                return(Json(new { success = false, msg = "有不在销售状态的商品存在,不可执行上架操作" }));
            }
            if (ShopBranchApplication.IsOpenLadderInProducts(ids))
            {
                return(Json(new { success = false, msg = "有商品为阶梯批发商品,不能上架到门店" }));
            }
            ShopBranchApplication.AddProductSkus(ids, shopbranchId, CurrentSellerManager.ShopId);
            ShopBranchApplication.OnSaleProduct(shopbranchId, ids);
            return(Json(new { success = true, msg = "已上架" }));
        }
        public object GetOnSaleProduct(string pids)
        {
            CheckUserLogin();
            if (string.IsNullOrWhiteSpace(pids))
            {
                return new { success = false, msg = "参数异常" }
            }
            ;
            var ids = ConvertToIEnumerable(pids);

            if (!ShopBranchApplication.CanOnSaleProduct(ids))
            {
                return(new { success = false, msg = "有不在销售状态的商品存在,不可执行上架操作" });
            }
            if (ShopBranchApplication.IsOpenLadderInProducts(ids))
            {
                return(new { success = false, msg = "有商品为阶梯批发商品,不能上架到门店" });
            }
            ShopBranchApplication.OnSaleProduct(CurrentShopBranch.Id, ids);
            return(new { success = true, msg = "已上架" });
        }