Exemplo n.º 1
0
 public ShopSettingsApiController(IShopSettingsService shopSettingsService, ISettingsService settingsService, IShopCategoryService shopCategoryService, IShopManufacturerService manufacturerService)
 {
     _shopSettingsService = shopSettingsService;
     _settingsService     = settingsService;
     _shopCategoryService = shopCategoryService;
     _manufacturerService = manufacturerService;
 }
Exemplo n.º 2
0
        public decimal GetNeedPayCashDepositByShopId(long shopId)
        {
            decimal              num    = new decimal(0, 0, 0, false, 2);
            IShopService         create = Instance <IShopService> .Create;
            IShopCategoryService shopCategoryService = Instance <IShopCategoryService> .Create;
            List <CategoryInfo>  list             = shopCategoryService.GetBusinessCategory(shopId).ToList();
            IEnumerable <long>   parentCategoryId =
                from item in list
                where item.ParentCategoryId == 0
                select item.Id;
            //decimal num1 = context.CategoryCashDepositInfo.FindBy((CategoryCashDepositInfo item) => parentCategoryId.Contains(item.CategoryId)).Max<CategoryCashDepositInfo, decimal>((CategoryCashDepositInfo item) => item.NeedPayCashDeposit);
            decimal         num1            = 1;
            CashDepositInfo cashDepositInfo = (
                from item in context.CashDepositInfo
                where item.ShopId == shopId
                select item).FirstOrDefault();

            if (cashDepositInfo != null && cashDepositInfo.CurrentBalance < num1)
            {
                num = num1 - cashDepositInfo.CurrentBalance;
            }
            if (cashDepositInfo == null)
            {
                num = num1;
            }
            return(num);
        }
Exemplo n.º 3
0
 public HomeController(ILogger <HomeController> logger, IProductService productService, IShopCategoryService shopCategoryService, IShopCategoryFeatureService shopCategoryFeatureService)
 {
     _logger                     = logger;
     _productService             = productService ?? throw new ArgumentNullException(nameof(productService));
     _shopCategoryService        = shopCategoryService ?? throw new ArgumentNullException(nameof(shopCategoryService));
     _shopCategoryFeatureService = shopCategoryFeatureService ?? throw new ArgumentNullException(nameof(shopCategoryFeatureService));
 }
Exemplo n.º 4
0
 public LimitTimeBuyController(
     ILimitTimeBuyService iLimitTimeBuyService,
     ISlideAdsService iSlideAdsService,
     IShopService iShopService,
     IProductService iProductService,
     IProductDescriptionTemplateService iProductDescriptionTemplateService,
     IShopCategoryService iShopCategoryService,
     ICommentService iCommentService,
     IConsultationService iConsultationService,
     ICouponService iCouponService,
     ICashDepositsService iCashDepositsService, ITypeService iTypeService
     )
 {
     _iLimitTimeBuyService = iLimitTimeBuyService;
     _iSlideAdsService     = iSlideAdsService;
     _iShopService         = iShopService;
     _iProductService      = iProductService;
     _iProductDescriptionTemplateService = iProductDescriptionTemplateService;
     _iShopCategoryService = iShopCategoryService;
     _iCommentService      = iCommentService;
     _iConsultationService = iConsultationService;
     _iCouponService       = iCouponService;
     _iCashDepositsService = iCashDepositsService;
     _iTypeService         = iTypeService;
 }
Exemplo n.º 5
0
        public ShopController(ISessionValueProviderService sessionService, IShopService shopService,
                              ISearchService searchService, IShopClientService clientService, IShopActionService shopActionService,
                              IShopCategoryService shopCategoryService, IShopManufacturerService shopManufacturerService,
                              IPrincipalResolver principalResolver, IHeartService heartService, IShopOrderService shopOrderService, IShopPickupPointService pickupPointService)
        {
            _sessionService          = sessionService;
            _shopService             = shopService;
            _searchService           = searchService;
            _clientService           = clientService;
            _shopActionService       = shopActionService;
            _shopCategoryService     = shopCategoryService;
            _shopManufacturerService = shopManufacturerService;
            _principalResolver       = principalResolver;
            _heartService            = heartService;
            _shopOrderService        = shopOrderService;
            _pickupPointService      = pickupPointService;


            var service = DependencyResolver.Current.GetService <IShopSettingsService>();

            try
            {
                var settings = service.GetShopSettings();
                _shopUrl = String.IsNullOrEmpty(settings.ShopUrl) ? "catalog" : settings.ShopUrl;
            }
            catch
            {
                _shopUrl = "catalog";
            }
        }
Exemplo n.º 6
0
 public ExportShopService(ISettingsService settingsService, ILogService logService, IShopService shopService, IShopCategoryService shopCategoryService, IHeartService heartService)
 {
     _settingsService     = settingsService;
     _logService          = logService;
     _shopService         = shopService;
     _shopCategoryService = shopCategoryService;
     _heartService        = heartService;
 }
Exemplo n.º 7
0
        public ActionResult Management()
        {
            IShopCategoryService           shopCategoryService = ServiceHelper.Create <IShopCategoryService>();
            IEnumerable <ShopCategoryInfo> mainCategory        = shopCategoryService.GetMainCategory(base.CurrentSellerManager.ShopId);
            List <ShopCategoryModel>       shopCategoryModels  = new List <ShopCategoryModel>();

            foreach (ShopCategoryInfo shopCategoryInfo in mainCategory)
            {
                shopCategoryModels.Add(new ShopCategoryModel(shopCategoryInfo));
            }
            return(View(shopCategoryModels));
        }
Exemplo n.º 8
0
 public MobileHomeProducts(
     IMobileHomeProductsService iMobileHomeProductsService,
     IBrandService iBrandService,
     ICategoryService iCategoryService,
     IShopCategoryService iShopCategoryService
     )
 {
     _iBrandService              = iBrandService;
     _iCategoryService           = iCategoryService;
     _iMobileHomeProductsService = iMobileHomeProductsService;
     _iShopCategoryService       = iShopCategoryService;
 }
Exemplo n.º 9
0
 // Methods
 public LimitTimeBuyController(IShopCategoryService iShopCategoryService, ILimitTimeBuyService iLimitTimeBuyService, IShopService iShopService, IProductService iProductService, ICommentService iCommentService, IVShopService iVShopService, IConsultationService iConsultationService, IProductDescriptionTemplateService iProductDescriptionTemplateService, ICustomerService iCustomerService, ITypeService iTypeService)
 {
     this._iShopCategoryService = iShopCategoryService;
     this._iLimitTimeBuyService = iLimitTimeBuyService;
     this._iShopService         = iShopService;
     this._iProductService      = iProductService;
     this._iCommentService      = iCommentService;
     this._iVShopService        = iVShopService;
     this._iProductDescriptionTemplateService = iProductDescriptionTemplateService;
     this._iConsultationService = iConsultationService;
     this._iCustomerService     = iCustomerService;
     this._iTypeService         = iTypeService;
 }
Exemplo n.º 10
0
        public MobileHomeProductsController(
            IMobileHomeProductsService iMobileHomeProductsService,
            IBrandService iBrandService,
            ICategoryService iCategoryService,
            IShopCategoryService iShopCategoryService

            )
        {
            _iBrandService              = iBrandService;
            _iCategoryService           = iCategoryService;
            _iMobileHomeProductsService = iMobileHomeProductsService;
            _iShopCategoryService       = iShopCategoryService;
            mobileHomeproduct           = new MobileHomeProducts(_iMobileHomeProductsService, _iBrandService, _iCategoryService, _iShopCategoryService);
        }
Exemplo n.º 11
0
 public ShopController(IShopService shopService
                       , IShopCategoryService shopCategoryService
                       , IShopCommentService shopCommentService
                       , IProductService productService
                       , IUserFavShopService userFavShopService
                       , IUserService userService)
     : base(userService)
 {
     _shopService         = shopService;
     _shopCategoryService = shopCategoryService;
     _shopCommentService  = shopCommentService;
     _productService      = productService;
     _userFavShopService  = userFavShopService;
 }
Exemplo n.º 12
0
 public ProductsController(IProductService productService, IShopCategoryService shopCategoryService, ITagService tagService, IBrandService brandService, IProductShopCategoryService productShopCategoryService, IProductTagService productTagService, IProductMediaService productMediaService, IProductAttributeService productAttributeService, IFeatureService featureService, IFeatureAttributeService featureAttributeService, IShopCategoryFeatureService shopCategoryFeatureService)
 {
     _productService             = productService ?? throw new ArgumentNullException(nameof(productService));
     _shopCategoryService        = shopCategoryService ?? throw new ArgumentNullException(nameof(shopCategoryService));
     _tagService                 = tagService ?? throw new ArgumentNullException(nameof(tagService));
     _brandService               = brandService ?? throw new ArgumentNullException(nameof(brandService));
     _productShopCategoryService = productShopCategoryService ?? throw new ArgumentNullException(nameof(productShopCategoryService));
     _productTagService          = productTagService ?? throw new ArgumentNullException(nameof(productTagService));
     _productMediaService        = productMediaService ?? throw new ArgumentNullException(nameof(productMediaService));
     _productAttributeService    = productAttributeService ?? throw new ArgumentNullException(nameof(productAttributeService));
     _featureService             = featureService ?? throw new ArgumentNullException(nameof(featureService));
     _featureAttributeService    = featureAttributeService ?? throw new ArgumentNullException(nameof(featureAttributeService));
     _shopCategoryFeatureService = shopCategoryFeatureService ?? throw new ArgumentNullException(nameof(shopCategoryFeatureService));
 }
Exemplo n.º 13
0
        public CashDepositsObligation GetCashDepositsObligation(long productId)
        {
            CashDepositsObligation cashDepositsObligation = new CashDepositsObligation()
            {
                IsCustomerSecurity       = false,
                IsSevenDayNoReasonReturn = false,
                IsTimelyShip             = false
            };
            CashDepositsObligation enableNoReasonReturn = cashDepositsObligation;
            IProductService        create              = Instance <IProductService> .Create;
            IShopService           shopService         = Instance <IShopService> .Create;
            IShopCategoryService   shopCategoryService = Instance <IShopCategoryService> .Create;
            ICategoryService       categoryService     = Instance <ICategoryService> .Create;
            ProductInfo            product             = create.GetProduct(productId);
            ShopInfo shop = shopService.GetShop(product.ShopId, false);

            CashDepositInfo cashDepositInfo = (
                from item in context.CashDepositInfo
                where item.ShopId == shop.Id
                select item).FirstOrDefault();
            List <CategoryInfo> list             = shopCategoryService.GetBusinessCategory(shop.Id).ToList();
            IEnumerable <long>  parentCategoryId =
                from item in list
                where item.ParentCategoryId == 0
                select item.Id;
            //decimal num = context.CategoryCashDepositInfo.FindBy((CategoryCashDepositInfo item) => parentCategoryId.Contains(item.CategoryId)).Max<CategoryCashDepositInfo, decimal>((CategoryCashDepositInfo item) => item.NeedPayCashDeposit);
            decimal num = 1;

            if (shop.IsSelf || cashDepositInfo != null && cashDepositInfo.CurrentBalance >= num || cashDepositInfo != null && cashDepositInfo.CurrentBalance < num && cashDepositInfo.EnableLabels)
            {
                List <long> nums = new List <long>()
                {
                    product.CategoryId
                };
                CategoryInfo            categoryInfo            = categoryService.GetTopLevelCategories(nums).FirstOrDefault();
                CategoryCashDepositInfo categoryCashDepositInfo = (
                    from item in context.CategoryCashDepositInfo
                    where item.CategoryId == categoryInfo.Id
                    select item).FirstOrDefault();
                enableNoReasonReturn.IsSevenDayNoReasonReturn = categoryCashDepositInfo.EnableNoReasonReturn;
                enableNoReasonReturn.IsCustomerSecurity       = true;
                if (!string.IsNullOrEmpty(product.ChemCloud_FreightTemplate.SendTime))
                {
                    enableNoReasonReturn.IsTimelyShip = true;
                }
            }
            return(enableNoReasonReturn);
        }
Exemplo n.º 14
0
 public ShopService(ILogService logService, IShopActionService shopActionService, IShopCategoryService shopCategoryService, IShopSpecService shopSpecService, IShopCompatiblesService shopCompatiblesService, IShopPackService shopPackService, IShopManufacturerService shopManufacturerService, IHeartService heartService, IShopGoodsReviewService goodsReviewService, ISearchService searchService)
 {
     _logService              = logService;
     _shopActionService       = shopActionService;
     _shopCategoryService     = shopCategoryService;
     _shopSpecService         = shopSpecService;
     _shopCompatiblesService  = shopCompatiblesService;
     _shopPackService         = shopPackService;
     _shopManufacturerService = shopManufacturerService;
     _heartService            = heartService;
     _goodsReviewService      = goodsReviewService;
     _searchService           = searchService;
     InitCache("ShopService");
     // Reindex();
     // GenerateRelativeUrls();
 }
Exemplo n.º 15
0
 public ProductController(
     IProductService iProductService,
     IBrandService iBrandService,
     ICategoryService iCategoryService,
     IShopService iShopService,
     ISearchProductService iSearchProductService,
     IShopCategoryService iShopCategoryService
     )
 {
     _iProductService       = iProductService;
     _iBrandService         = iBrandService;
     _iCategoryService      = iCategoryService;
     _iShopService          = iShopService;
     _iSearchProductService = iSearchProductService;
     _iShopCategoryService  = iShopCategoryService;
 }
Exemplo n.º 16
0
        public static List <BreadCrumb> ForShopCategory(int categoryId)
        {
            IShopCategoryService shopCategoryService = DependencyResolver.Current.GetService <IShopCategoryService>();
            IList <Category>     categories          = shopCategoryService.GetParentCategoriesWithCurrent(categoryId);
            List <BreadCrumb>    result = new List <BreadCrumb>();
            UrlHelper            helper = new UrlHelper(HttpContext.Current.Request.RequestContext);

            foreach (var category in categories)
            {
                result.Add(new BreadCrumb()
                {
                    Title  = category.Name,
                    Url    = helper.RouteUrl("CatalogSEF", new { relativeURL = category.CanonicalUrl }),
                    IsLast = categories.Last() == category
                });
            }
            return(result);
        }
Exemplo n.º 17
0
 public ShopController(ICouponService iCouponService, IShopService iShopService, IShopCategoryService iShopCategoryService, IVShopService iVShopService
                       , IShopHomeModuleService iShopHomeModuleService, IRegionService iRegionService, INavigationService iNavigationService, ISlideAdsService iSlideAdsService
                       , IProductService iProductService,
                       IMemberService iMemberService,
                       ISearchProductService iSearchProductService
                       )
 {
     _iCouponService         = iCouponService;
     _iShopService           = iShopService;
     _iShopCategoryService   = iShopCategoryService;
     _iVShopService          = iVShopService;
     _iShopHomeModuleService = iShopHomeModuleService;
     _iRegionService         = iRegionService;
     _iNavigationService     = iNavigationService;
     _iSlideAdsService       = iSlideAdsService;
     _iProductService        = iProductService;
     _iMemberService         = iMemberService;
     _iSearchProductService  = iSearchProductService;
 }
        public object GetSellerMobileHomePageProducts(long shopId, PlatformType platformType, int page, int rows, string brandName, long?categoryId = new long?())
        {
            ProductQuery productQuery = new ProductQuery
            {
                ShopCategoryId = categoryId,
                KeyWords       = brandName,
                PageSize       = rows,
                PageNo         = page
            };
            ObsoletePageModel <MobileHomeProductsInfo> model = this._iMobileHomeProductsService.GetSellerMobileHomePageProducts(shopId, platformType, productQuery);
            IBrandService        brandService = this._iBrandService;
            IShopCategoryService service      = this._iShopCategoryService;

            return(new
            {
                rows = model.Models.ToArray().Select(delegate(MobileHomeProductsInfo item)
                {
                    BrandInfo brand = brandService.GetBrand(item.Himall_Products.BrandId);
                    ProductShopCategoryInfo info2 = item.Himall_Products.Himall_ProductShopCategories.FirstOrDefault <ProductShopCategoryInfo>();
                    return new { name = item.Himall_Products.ProductName, image = item.Himall_Products.GetImage(ImageSize.Size_50, 1), price = item.Himall_Products.MinSalePrice.ToString("F2"), brand = (brand == null) ? "" : brand.Name, sequence = item.Sequence, id = item.Id, categoryName = (info2 == null) ? "" : info2.ShopCategoryInfo.Name, productId = item.ProductId };
                }),
                total = model.Total
            });
        }
Exemplo n.º 19
0
 public FeaturesController(IFeatureService productFeatureService, IShopCategoryService shopCategoryService, IShopCategoryFeatureService shopCategoryFeatureService)
 {
     _productFeatureService      = productFeatureService ?? throw new ArgumentNullException(nameof(productFeatureService));
     _shopCategoryService        = shopCategoryService ?? throw new ArgumentNullException(nameof(shopCategoryService));
     _shopCategoryFeatureService = shopCategoryFeatureService ?? throw new ArgumentNullException(nameof(shopCategoryFeatureService));
 }
Exemplo n.º 20
0
 public BrandsController(IBrandService brandService, IShopCategoryService shopCategoryService)
 {
     _brandService        = brandService ?? throw new ArgumentNullException(nameof(brandService));
     _shopCategoryService = shopCategoryService ?? throw new ArgumentNullException(nameof(shopCategoryService));
 }
Exemplo n.º 21
0
 public CategoryController(ICategoryService iCategoryService, IShopCategoryService iShopCategoryService)
 {
     _iCategoryService     = iCategoryService;
     _iShopCategoryService = iShopCategoryService;
 }
Exemplo n.º 22
0
 public ShopCategoryController(IShopCategoryService service)
 {
     _service = service;
 }
Exemplo n.º 23
0
 public ShopBranchCategoryController()
 {
     _ishopCategoryService = ServiceProvider.Instance <IShopCategoryService> .Create;
 }
Exemplo n.º 24
0
        public JsonResult GetVshops(int page, int rows, string vshopName, int?vshopType = null)
        {
            Func <VShopExtendInfo, bool> func  = null;
            Func <VShopExtendInfo, bool> func1 = null;
            int        num        = 0;
            VshopQuery vshopQuery = new VshopQuery()
            {
                Name     = vshopName,
                PageNo   = page,
                PageSize = rows
            };
            VshopQuery nullable  = vshopQuery;
            int?       nullable1 = vshopType;

            if ((nullable1.GetValueOrDefault() != 1 ? false : nullable1.HasValue))
            {
                nullable.VshopType = new VShopExtendInfo.VShopExtendType?(VShopExtendInfo.VShopExtendType.TopShow);
            }
            int?nullable2 = vshopType;

            if ((nullable2.GetValueOrDefault() != 2 ? false : nullable2.HasValue))
            {
                nullable.VshopType = new VShopExtendInfo.VShopExtendType?(VShopExtendInfo.VShopExtendType.HotVShop);
            }
            int?nullable3 = vshopType;

            if ((nullable3.GetValueOrDefault() != 0 ? false : nullable3.HasValue))
            {
                nullable.VshopType = new VShopExtendInfo.VShopExtendType?(0);
            }
            List <VShopInfo> list = ServiceHelper.Create <IVShopService>().GetVShopByParamete(nullable, out num).ToList();

            num = list.Count();
            ICategoryService     categoryService     = ServiceHelper.Create <ICategoryService>();
            IShopCategoryService shopCategoryService = ServiceHelper.Create <IShopCategoryService>();
            var collection = list.ToArray().Select((VShopInfo item) => {
                string str;
                long id     = item.Id;
                string name = item.Name;
                string str1 = item.CreateTime.ToString();
                ICollection <VShopExtendInfo> vShopExtendInfo = item.VShopExtendInfo;
                if (func == null)
                {
                    func = (VShopExtendInfo t) => t.Type == VShopExtendInfo.VShopExtendType.TopShow;
                }
                if (vShopExtendInfo.Any(func))
                {
                    str = "主推微店";
                }
                else
                {
                    ICollection <VShopExtendInfo> vShopExtendInfos = item.VShopExtendInfo;
                    if (func1 == null)
                    {
                        func1 = (VShopExtendInfo t) => t.Type == VShopExtendInfo.VShopExtendType.HotVShop;
                    }
                    str = (vShopExtendInfos.Any(func1) ? "热门微店" : "普通微店");
                }
                return(new { id = id, name = name, creatTime = str1, vshopTypes = str, categoryName = (shopCategoryService.GetBusinessCategory(item.ShopId).FirstOrDefault() != null ? categoryService.GetCategory(long.Parse(shopCategoryService.GetBusinessCategory(item.ShopId).FirstOrDefault().Path.Split(new char[] { '|' }).First <string>())).Name : ""), visiteNum = item.VisitNum, buyNum = item.buyNum });
            });

            return(Json(new { rows = collection, total = num }));
        }
 public ShopCategoriesController(IShopCategoryService shopCategoryService, IShopCategoryFeatureService shopCategoryFeatureService)
 {
     _shopCategoryService        = shopCategoryService ?? throw new ArgumentNullException(nameof(shopCategoryService));
     _shopCategoryFeatureService = shopCategoryFeatureService ?? throw new ArgumentNullException(nameof(shopCategoryFeatureService));
 }
Exemplo n.º 26
0
 public CategoryApiController(IShopCategoryService shopCategoryService)
 {
     _shopCategoryService = shopCategoryService;
 }
Exemplo n.º 27
0
 public ShopProductController(IShopProductService service, IShopCategoryService categoryService)
 {
     _service = service;
     _categoryService = categoryService;
 }
Exemplo n.º 28
0
 public ShopCategoryController(IShopCategoryService shopCategoriesService, IClaimsGetter claimsGetter, IUsersService usersService)
 {
     _shopCategoriesService = shopCategoriesService;
     _claimsGetter          = claimsGetter;
     _usersService          = usersService;
 }
Exemplo n.º 29
0
 public VShopController(IVShopService iVShopService, ICategoryService iCategoryService, IShopCategoryService iShopCategoryService)
 {
     _iVShopService        = iVShopService;
     _iCategoryService     = iCategoryService;
     _iShopCategoryService = iShopCategoryService;
 }