当前位置: 首页>>代码示例>>C#>>正文


C# Manufacturer.ValidateSeName方法代码示例

本文整理汇总了C#中Nop.Core.Domain.Catalog.Manufacturer.ValidateSeName方法的典型用法代码示例。如果您正苦于以下问题:C# Manufacturer.ValidateSeName方法的具体用法?C# Manufacturer.ValidateSeName怎么用?C# Manufacturer.ValidateSeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nop.Core.Domain.Catalog.Manufacturer的用法示例。


在下文中一共展示了Manufacturer.ValidateSeName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ResolveBrand

        private Manufacturer ResolveBrand(string brandName)
        {
            Manufacturer brand = _manufacturerService.GetAllManufacturers(brandName).FirstOrDefault();
            if (brand != null) return brand;
            brand = new Manufacturer
            {
                Name = brandName,
                AllowCustomersToSelectPageSize = true,
                //Description = brandName,
                MetaDescription = brandName,
                MetaKeywords = brandName,
                MetaTitle = brandName,
                ManufacturerTemplateId = 1,
                LimitedToStores = false,
                DisplayOrder = 1,
                PageSize = 8,
                PageSizeOptions = "4,8,12",
                SubjectToAcl = false,
                Published = true,
                CreatedOnUtc = DateTime.UtcNow,
                UpdatedOnUtc = DateTime.UtcNow
            };
            _manufacturerService.InsertManufacturer(brand);
            _urlRecordService.SaveSlug(brand, brand.ValidateSeName(brandName, brandName, true), 0);

            return _manufacturerService.GetAllManufacturers(brandName).First();
        }
开发者ID:aleks279,项目名称:atrend-test,代码行数:27,代码来源:ProductResolver.cs

示例2: UpdateLocales

        protected void UpdateLocales(Manufacturer manufacturer, ManufacturerModel model)
        {
            foreach (var localized in model.Locales)
            {
                _localizedEntityService.SaveLocalizedValue(manufacturer,
                                                               x => x.Name,
                                                               localized.Name,
                                                               localized.LanguageId);

                _localizedEntityService.SaveLocalizedValue(manufacturer,
                                                           x => x.Description,
                                                           localized.Description,
                                                           localized.LanguageId);

                _localizedEntityService.SaveLocalizedValue(manufacturer,
                                                           x => x.MetaKeywords,
                                                           localized.MetaKeywords,
                                                           localized.LanguageId);

                _localizedEntityService.SaveLocalizedValue(manufacturer,
                                                           x => x.MetaDescription,
                                                           localized.MetaDescription,
                                                           localized.LanguageId);

                _localizedEntityService.SaveLocalizedValue(manufacturer,
                                                           x => x.MetaTitle,
                                                           localized.MetaTitle,
                                                           localized.LanguageId);

                //search engine name
                var seName = manufacturer.ValidateSeName(localized.SeName, localized.Name, false);
                _urlRecordService.SaveSlug(manufacturer, seName, localized.LanguageId);
            }
        }
开发者ID:haithemChkel,项目名称:nopCommerce_33,代码行数:34,代码来源:ManufacturerController.cs

示例3: UpdateLocales

        protected virtual List<LocalizedProperty> UpdateLocales(Manufacturer manufacturer, ManufacturerModel model)
        {
            List<LocalizedProperty> localized = new List<LocalizedProperty>();

            foreach (var local in model.Locales)
            {
                if (!(String.IsNullOrEmpty(local.Description)))
                    localized.Add(new LocalizedProperty()
                    {
                        LanguageId = local.LanguageId,
                        LocaleKey = "Description",
                        LocaleValue = local.Description,
                        _id = ObjectId.GenerateNewId().ToString(),
                        Id = localized.Count > 0 ? localized.Max(x => x.Id) + 1 : 1,
                    });

                if (!(String.IsNullOrEmpty(local.MetaDescription)))
                    localized.Add(new LocalizedProperty()
                    {
                        LanguageId = local.LanguageId,
                        LocaleKey = "MetaDescription",
                        LocaleValue = local.MetaDescription,
                        _id = ObjectId.GenerateNewId().ToString(),
                        Id = localized.Count > 0 ? localized.Max(x => x.Id) + 1 : 1,
                    });

                if (!(String.IsNullOrEmpty(local.MetaKeywords)))
                    localized.Add(new LocalizedProperty()
                    {
                        LanguageId = local.LanguageId,
                        LocaleKey = "MetaKeywords",
                        LocaleValue = local.MetaKeywords,
                        _id = ObjectId.GenerateNewId().ToString(),
                        Id = localized.Count > 0 ? localized.Max(x => x.Id) + 1 : 1,
                    });

                if (!(String.IsNullOrEmpty(local.MetaTitle)))
                    localized.Add(new LocalizedProperty()
                    {
                        LanguageId = local.LanguageId,
                        LocaleKey = "MetaTitle",
                        LocaleValue = local.MetaTitle,
                        _id = ObjectId.GenerateNewId().ToString(),
                        Id = localized.Count > 0 ? localized.Max(x => x.Id) + 1 : 1,
                    });

                if (!(String.IsNullOrEmpty(local.Name)))
                    localized.Add(new LocalizedProperty()
                    {
                        LanguageId = local.LanguageId,
                        LocaleKey = "Name",
                        LocaleValue = local.Name,
                        _id = ObjectId.GenerateNewId().ToString(),
                        Id = localized.Count > 0 ? localized.Max(x => x.Id) + 1 : 1,
                    });

                //search engine name
                var seName = manufacturer.ValidateSeName(local.SeName, local.Name, false);
                _urlRecordService.SaveSlug(manufacturer, seName, local.LanguageId);

                if (!(String.IsNullOrEmpty(seName)))
                    localized.Add(new LocalizedProperty()
                    {
                        LanguageId = local.LanguageId,
                        LocaleKey = "SeName",
                        LocaleValue = seName,
                        _id = ObjectId.GenerateNewId().ToString(),
                        Id = localized.Count > 0 ? localized.Max(x => x.Id) + 1 : 1,
                    });
            }
            return localized;
        }
开发者ID:grandnode,项目名称:grandnode,代码行数:72,代码来源:ManufacturerController.cs


注:本文中的Nop.Core.Domain.Catalog.Manufacturer.ValidateSeName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。