本文整理汇总了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();
}
示例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);
}
}
示例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;
}