Esempio n. 1
0
        public virtual ActionResult GetAllMarketImages([DataSourceRequest] DataSourceRequest request,
                                                       int?market,
                                                       string marketplaceId,
                                                       string keywords,
                                                       bool onlyIgnored)
        {
            LogI("GetAllMarketImages, market=" + market
                 + ", marketplaceId=" + marketplaceId
                 + ", keywords=" + keywords
                 + ", onlyIgnored=" + onlyIgnored);

            request.Sorts = BuildFrom(this.Request.Params);

            var items = MarketImageViewModel.GetAll(Db,
                                                    (MarketType)(market ?? (int)MarketType.Walmart),
                                                    marketplaceId,
                                                    keywords,
                                                    onlyIgnored);

            var dataSource = items.ToDataSourceResult(request);

            return(new JsonResult {
                Data = dataSource, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 2
0
        public virtual ActionResult ReplaceStyleImage(long id)
        {
            LogI("ReplaceStyleImage, itemImageId=" + id);

            var result = MarketImageViewModel.ReplaceStyleImage(Db, LogService, id, Time.GetAppNowTime(), AccessManager.UserId);

            if (result.IsSuccess)
            {
                return(JsonGet(ValueResult <string> .Success(result.Data)));
            }
            return(JsonGet(ValueResult <string> .Error(result.Message)));
        }
Esempio n. 3
0
        public virtual ActionResult ToggleIgnoreItemImage(long id, bool isIgnored)
        {
            MarketImageViewModel.ToggleIgnoreItemImage(Db, LogService, id, isIgnored);

            return(JsonGet(MessageResult.Success()));
        }
Esempio n. 4
0
        public virtual ActionResult ResetItemImageDiff(long id)
        {
            MarketImageViewModel.ResetItemImageDiff(Db, LogService, id);

            return(JsonGet(MessageResult.Success()));
        }
Esempio n. 5
0
        public virtual ActionResult ResetItemLargeIncludeParentImage(long id)
        {
            MarketImageViewModel.ResetItemLargeImage(Db, LogService, id, true);

            return(JsonGet(MessageResult.Success()));
        }