public ActionResult GoogleProductUpdate(Zbozi.Models.ZboziFeedModel.GoogleProductModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManagePlugins))
            {
                return(Content("Access denied"));
            }

            var zboziProduct = _zboziService.GetByProductId(model.ProductId);

            if (zboziProduct != null)
            {
                zboziProduct.Taxonomy       = model.ZboziCategory;
                zboziProduct.Gender         = model.Gender;
                zboziProduct.AgeGroup       = model.AgeGroup;
                zboziProduct.Color          = model.Color;
                zboziProduct.Size           = model.GoogleSize;
                zboziProduct.CustomGoods    = model.CustomGoods;
                zboziProduct.MAX_CPC        = model.MAXCPC;
                zboziProduct.MAX_CPC_SEARCH = model.MAXCPC_SEARCH;
                zboziProduct.ProductName    = model.ZboziProductName;
                zboziProduct.EXTRA_MESSAGE  = model.EXTRAMESSAGE;


                _zboziService.UpdateGoogleProductRecord(zboziProduct);
            }
            else
            {
                //insert
                zboziProduct = new ZboziProductRecord
                {
                    ProductId      = model.ProductId,
                    Taxonomy       = model.ZboziCategory,
                    MAX_CPC        = model.MAXCPC,
                    EXTRA_MESSAGE  = model.EXTRAMESSAGE,
                    MAX_CPC_SEARCH = model.MAXCPC_SEARCH,
                    ProductName    = model.ZboziProductName,
                    Gender         = model.Gender,
                    AgeGroup       = model.AgeGroup,
                    Color          = model.Color,
                    Size           = model.GoogleSize,
                    CustomGoods    = model.CustomGoods
                };
                _zboziService.InsertGoogleProductRecord(zboziProduct);
            }

            return(new NullJsonResult());
        }
        public ActionResult GoogleProductList(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManagePlugins))
            {
                return(ErrorForKendoGridJson("Access denied"));
            }

            var products = _productService.SearchProducts(pageIndex: command.Page - 1,
                                                          pageSize: command.PageSize, showHidden: true);
            var productsModel = products
                                .Select(x =>
            {
                var gModel = new Zbozi.Models.ZboziFeedModel.GoogleProductModel
                {
                    ProductId   = x.Id,
                    ProductName = x.Name
                };
                var googleProduct = _zboziService.GetByProductId(x.Id);
                if (googleProduct != null)
                {
                    gModel.ZboziCategory    = googleProduct.Taxonomy;
                    gModel.Gender           = googleProduct.Gender;
                    gModel.AgeGroup         = googleProduct.AgeGroup;
                    gModel.Color            = googleProduct.Color;
                    gModel.GoogleSize       = googleProduct.Size;
                    gModel.CustomGoods      = googleProduct.CustomGoods;
                    gModel.EXTRAMESSAGE     = googleProduct.EXTRA_MESSAGE;
                    gModel.MAXCPC           = googleProduct.MAX_CPC;
                    gModel.ZboziProductName = googleProduct.ProductName;
                    gModel.MAXCPC_SEARCH    = googleProduct.MAX_CPC_SEARCH;
                }

                return(gModel);
            })
                                .ToList();

            var gridModel = new DataSourceResult
            {
                Data  = productsModel,
                Total = products.TotalCount
            };

            return(Json(gridModel));
        }