public Page_Bookmarks(GoogleProductModel googleProduct)
 {
     this.googleProduct = googleProduct;
     InitializeComponent();
     productObject        = (Bookmarks)googleProduct.ProductObject;
     dataGrid.ItemsSource = productObject.bookmarks;
 }
Пример #2
0
        public IActionResult Edit(int id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings))
            {
                return(AccessDeniedView());
            }

            var googleProduct = _googleService.GetByProductId(id);

            var model = new GoogleProductModel
            {
                ProductId = id
            };

            if (googleProduct == null)
            {
                return(View("~/Plugins/Feed.GoogleShopping/Views/Edit.cshtml", model));
            }

            model = new GoogleProductModel
            {
                Id             = googleProduct.Id,
                ProductId      = googleProduct.ProductId,
                Color          = googleProduct.Color,
                AgeGroup       = googleProduct.AgeGroup,
                CustomGoods    = googleProduct.CustomGoods,
                Gender         = googleProduct.Gender,
                GoogleSize     = googleProduct.Size,
                GoogleCategory = googleProduct.Taxonomy
            };

            return(View("~/Plugins/Feed.GoogleShopping/Views/Edit.cshtml", model));
        }
 public Page_Blogger(GoogleProductModel googleProduct)
 {
     this.googleProduct = googleProduct;
     InitializeComponent();
     productObject        = (Blogger)googleProduct.ProductObject;
     dataGrid.ItemsSource = productObject.blogList;
 }
Пример #4
0
 public Page_Cloud_Print(GoogleProductModel googleProduct)
 {
     this.googleProduct = googleProduct;
     InitializeComponent();
     productObject        = (Cloud_Print)googleProduct.ProductObject;
     dataGrid.ItemsSource = productObject.printerList;
 }
 public Page_Assistant_Notes_and_Lists(GoogleProductModel googleProduct)
 {
     this.googleProduct = googleProduct;
     InitializeComponent();
     productObject        = (Assistant_Notes_and_Lists)googleProduct.ProductObject;
     dataGrid.ItemsSource = productObject.shoppingList_list;
 }
Пример #6
0
        public IActionResult GoogleProductList(GoogleProductSearchModel searchModel)
        {
            var storeId  = _storeContext.ActiveStoreScopeConfiguration;
            var products = _productService.SearchProducts(
                storeId: storeId,
                pageIndex: searchModel.Page - 1,
                pageSize: searchModel.PageSize,
                showHidden: true);

            //prepare list model
            var model = new GoogleProductListModel().PrepareToGrid(searchModel, products, () =>
            {
                return(products.Select(product =>
                {
                    var gModel = new GoogleProductModel
                    {
                        ProductId = product.Id,
                        ProductName = product.Name
                    };
                    var googleProduct = _googleService.GetByProductId(product.Id);
                    if (googleProduct != null)
                    {
                        gModel.GoogleCategory = googleProduct.Taxonomy;
                        gModel.Gender = googleProduct.Gender;
                        gModel.AgeGroup = googleProduct.AgeGroup;
                        gModel.Color = googleProduct.Color;
                        gModel.GoogleSize = googleProduct.Size;
                        gModel.CustomGoods = googleProduct.CustomGoods;
                    }
                    return gModel;
                }));
            });

            return(Json(model));
        }
Пример #7
0
 public Page_Classic_Sites(GoogleProductModel googleProduct)
 {
     this.googleProduct = googleProduct;
     InitializeComponent();
     productObject        = (Classic_Sites)googleProduct.ProductObject;
     dataGrid.ItemsSource = productObject.siteList;
 }
Пример #8
0
 public Page_Android_Device_Configuration_Service(GoogleProductModel googleProduct)
 {
     this.googleProduct = googleProduct;
     InitializeComponent();
     productObject        = (Android_Device_Configuration_Service)googleProduct.ProductObject;
     dataGrid.ItemsSource = productObject.devicesList;
 }
Пример #9
0
        public virtual GridModel <GoogleProductModel> GetGridModel(GridCommand command, string searchProductName = null)
        {
            var searchContext = new ProductSearchContext()
            {
                Keywords   = searchProductName,
                PageIndex  = command.Page - 1,
                PageSize   = command.PageSize,
                ShowHidden = true
            };

            var products = _productService.SearchProducts(searchContext);

            var data = products.Select(x =>
            {
                var gModel = new GoogleProductModel()
                {
                    ProductId   = x.Id,
                    ProductName = x.Name
                };

                var googleProduct = GetByProductId(x.Id);

                if (googleProduct != null)
                {
                    gModel.GoogleCategory = googleProduct.Taxonomy;
                    gModel.Gender         = googleProduct.Gender;
                    gModel.AgeGroup       = googleProduct.AgeGroup;
                    gModel.Color          = googleProduct.Color;
                    gModel.GoogleSize     = googleProduct.Size;

                    if (gModel.Gender.HasValue())
                    {
                        gModel.GenderLocalize = Helper.Resource("Gender" + CultureInfo.InvariantCulture.TextInfo.ToTitleCase(gModel.Gender));
                    }

                    if (gModel.AgeGroup.HasValue())
                    {
                        gModel.AgeGroupLocalize = Helper.Resource("AgeGroup" + CultureInfo.InvariantCulture.TextInfo.ToTitleCase(gModel.AgeGroup));
                    }
                }

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

            var model = new GridModel <GoogleProductModel>()
            {
                Data  = data,
                Total = products.TotalCount
            };

            return(model);
        }
        private void product_worker(GoogleProductModel product)
        {
            enterLog("Working on module: " + product.ProductName + " in path, " + product.ProductFolderPath);
            var    tuple  = HelpfulMethods.ByteToString(product.DirSize);
            string result = String.Format("{0:0.##} {1}", tuple.Item1, tuple.Item2);

            enterLog("The size is " + result);

            //Starting worker
            GoogleProductsList.StartWork(product, this);
            enterLog("\n");
            //DONE Worker
        }
Пример #11
0
        public IActionResult Edit(GoogleProductModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManagePlugins))
            {
                return(AccessDeniedView());
            }

            var googleProduct = _googleService.GetByProductId(model.ProductId);

            if (googleProduct != null)
            {
                googleProduct.Taxonomy    = model.GoogleCategory;
                googleProduct.Gender      = model.Gender;
                googleProduct.AgeGroup    = model.AgeGroup;
                googleProduct.Color       = model.Color;
                googleProduct.Size        = model.GoogleSize;
                googleProduct.CustomGoods = model.CustomGoods;
                _googleService.UpdateGoogleProductRecord(googleProduct);
            }
            else
            {
                //insert
                googleProduct = new GoogleProductRecord
                {
                    ProductId   = model.ProductId,
                    Taxonomy    = model.GoogleCategory,
                    Gender      = model.Gender,
                    AgeGroup    = model.AgeGroup,
                    Color       = model.Color,
                    Size        = model.GoogleSize,
                    CustomGoods = model.CustomGoods
                };
                _googleService.InsertGoogleProductRecord(googleProduct);
            }

            ViewBag.RefreshPage = true;

            return(View("~/Plugins/Feed.GoogleShopping/Views/Edit.cshtml", model));
        }
Пример #12
0
 public Page_Chrome(GoogleProductModel googleProduct)
 {
     this.googleProduct = googleProduct;
     InitializeComponent();
 }
Пример #13
0
        public ActionResult ProductEditTab(int productId)
        {
            var model = new GoogleProductModel {
                ProductId = productId
            };
            var entity = _googleService.GetGoogleProductRecord(productId);

            if (entity != null)
            {
                model.Taxonomy  = entity.Taxonomy;
                model.Gender    = entity.Gender;
                model.AgeGroup  = entity.AgeGroup;
                model.Color     = entity.Color;
                model.Size      = entity.Size;
                model.Material  = entity.Material;
                model.Pattern   = entity.Pattern;
                model.Exporting = entity.Export;
            }

            ViewBag.DefaultCategory = _settings.DefaultGoogleCategory;
            ViewBag.DefaultGender   = T("Common.Auto");
            ViewBag.DefaultAgeGroup = T("Common.Auto");
            ViewBag.DefaultColor    = _settings.Color;
            ViewBag.DefaultSize     = _settings.Size;
            ViewBag.DefaultMaterial = _settings.Material;
            ViewBag.DefaultPattern  = _settings.Pattern;

            var ci = CultureInfo.InvariantCulture;

            if (_settings.Gender.HasValue() && _settings.Gender != PluginHelper.NotSpecified)
            {
                ViewBag.DefaultGender = T("Plugins.Feed.Froogle.Gender" + ci.TextInfo.ToTitleCase(_settings.Gender));
            }

            if (_settings.AgeGroup.HasValue() && _settings.AgeGroup != PluginHelper.NotSpecified)
            {
                ViewBag.DefaultAgeGroup = T("Plugins.Feed.Froogle.AgeGroup" + ci.TextInfo.ToTitleCase(_settings.AgeGroup));
            }


            ViewBag.AvailableGenders = new List <SelectListItem>
            {
                new SelectListItem {
                    Value = "male", Text = T("Plugins.Feed.Froogle.GenderMale")
                },
                new SelectListItem {
                    Value = "female", Text = T("Plugins.Feed.Froogle.GenderFemale")
                },
                new SelectListItem {
                    Value = "unisex", Text = T("Plugins.Feed.Froogle.GenderUnisex")
                }
            };

            ViewBag.AvailableAgeGroups = new List <SelectListItem>
            {
                new SelectListItem {
                    Value = "adult", Text = T("Plugins.Feed.Froogle.AgeGroupAdult")
                },
                new SelectListItem {
                    Value = "kids", Text = T("Plugins.Feed.Froogle.AgeGroupKids")
                },
            };

            var result = PartialView(model);

            result.ViewData.TemplateInfo = new TemplateInfo {
                HtmlFieldPrefix = "CustomProperties[GMC]"
            };
            return(result);
        }
        public ActionResult ProductEditTab(int productId)
        {
            var culture = CultureInfo.InvariantCulture;
            var model   = new GoogleProductModel {
                ProductId = productId
            };
            var    entity       = _googleFeedService.GetGoogleProductRecord(productId);
            string notSpecified = T("Common.Unspecified");

            if (entity != null)
            {
                model.Taxonomy              = entity.Taxonomy;
                model.Gender                = entity.Gender;
                model.AgeGroup              = entity.AgeGroup;
                model.IsAdult               = entity.IsAdult;
                model.Color                 = entity.Color;
                model.Size                  = entity.Size;
                model.Material              = entity.Material;
                model.Pattern               = entity.Pattern;
                model.Export2               = entity.Export;
                model.Multipack2            = entity.Multipack;
                model.IsBundle              = entity.IsBundle;
                model.EnergyEfficiencyClass = entity.EnergyEfficiencyClass;
                model.CustomLabel0          = entity.CustomLabel0;
                model.CustomLabel1          = entity.CustomLabel1;
                model.CustomLabel2          = entity.CustomLabel2;
                model.CustomLabel3          = entity.CustomLabel3;
                model.CustomLabel4          = entity.CustomLabel4;
            }
            else
            {
                model.Export2 = true;
            }

            ViewBag.DefaultCategory              = "";
            ViewBag.DefaultColor                 = "";
            ViewBag.DefaultSize                  = "";
            ViewBag.DefaultMaterial              = "";
            ViewBag.DefaultPattern               = "";
            ViewBag.DefaultGender                = notSpecified;
            ViewBag.DefaultAgeGroup              = notSpecified;
            ViewBag.DefaultIsAdult               = "";
            ViewBag.DefaultMultipack2            = "";
            ViewBag.DefaultIsBundle              = "";
            ViewBag.DefaultEnergyEfficiencyClass = notSpecified;
            ViewBag.DefaultCustomLabel           = "";
            ViewBag.LanguageSeoCode              = Services.WorkContext.WorkingLanguage.UniqueSeoCode.EmptyNull().ToLower();

            // We do not have export profile context here, so we simply use the first profile.
            var profile = _exportService.Value.GetExportProfilesBySystemName(GmcXmlExportProvider.SystemName).FirstOrDefault();

            if (profile != null)
            {
                var config = XmlHelper.Deserialize(profile.ProviderConfigData, typeof(ProfileConfigurationModel)) as ProfileConfigurationModel;
                if (config != null)
                {
                    ViewBag.DefaultCategory = config.DefaultGoogleCategory;
                    ViewBag.DefaultColor    = config.Color;
                    ViewBag.DefaultSize     = config.Size;
                    ViewBag.DefaultMaterial = config.Material;
                    ViewBag.DefaultPattern  = config.Pattern;

                    if (config.Gender.HasValue() && config.Gender != GmcXmlExportProvider.Unspecified)
                    {
                        ViewBag.DefaultGender = T("Plugins.Feed.Froogle.Gender" + culture.TextInfo.ToTitleCase(config.Gender));
                    }

                    if (config.AgeGroup.HasValue() && config.AgeGroup != GmcXmlExportProvider.Unspecified)
                    {
                        ViewBag.DefaultAgeGroup = T("Plugins.Feed.Froogle.AgeGroup" + culture.TextInfo.ToTitleCase(config.AgeGroup));
                    }
                }
            }

            ViewBag.AvailableCategories = model.Taxonomy.HasValue()
                                ? new List <SelectListItem> {
                new SelectListItem {
                    Text = model.Taxonomy, Value = model.Taxonomy, Selected = true
                }
            }
                                : new List <SelectListItem>();

            ViewBag.AvailableGenders = new List <SelectListItem>
            {
                new SelectListItem {
                    Value = "male", Text = T("Plugins.Feed.Froogle.GenderMale")
                },
                new SelectListItem {
                    Value = "female", Text = T("Plugins.Feed.Froogle.GenderFemale")
                },
                new SelectListItem {
                    Value = "unisex", Text = T("Plugins.Feed.Froogle.GenderUnisex")
                }
            };

            ViewBag.AvailableAgeGroups = new List <SelectListItem>
            {
                new SelectListItem {
                    Value = "adult", Text = T("Plugins.Feed.Froogle.AgeGroupAdult")
                },
                new SelectListItem {
                    Value = "kids", Text = T("Plugins.Feed.Froogle.AgeGroupKids")
                },
            };

            ViewBag.AvailableEnergyEfficiencyClasses = T("Plugins.Feed.Froogle.EnergyEfficiencyClasses").Text
                                                       .SplitSafe(",")
                                                       .Select(x => new SelectListItem {
                Value = x, Text = x
            })
                                                       .ToList();

            var result = PartialView(model);

            result.ViewData.TemplateInfo = new TemplateInfo {
                HtmlFieldPrefix = "CustomProperties[GMC]"
            };
            return(result);
        }
 public Page_Drive(GoogleProductModel googleProduct)
 {
     this.googleProduct = googleProduct;
     InitializeComponent();
     productObject = (Drive)googleProduct.ProductObject;
 }
Пример #16
0
 public Page_Contacts(GoogleProductModel googleProduct)
 {
     this.googleProduct = googleProduct;
     InitializeComponent();
     productObject = (Contacts)googleProduct.ProductObject;
 }