/// <summary> /// Транслитерирует алиасы для закондательства /// </summary> /// <param name="domain"></param> public void UpdateLawsAliases(string domain) { var laws = _db.CmsLaws .Where(w => w.FSite.Equals(domain)); if (laws == null) { return; } foreach (var l in laws) { string group = Transliteration.Translit(l.FGroup).ToLower(); if (!string.IsNullOrEmpty(l.CNumber)) { l.CAlias = group + Transliteration.Translit(l.CNumber).Replace("/", ""); } else { string title = l.CTitle; if (title.Length > 30) { title = title.Substring(0, 30); } l.CAlias = group + "-" + Transliteration.Translit(title).Replace("/", "").Replace(" ", "-").ToLower(); } } }
/// <summary> /// Транслитерирует алиасы для календаря /// </summary> /// <param name="domain"></param> public void UpdateCalendarAliases(string domain) { var calendars = _db.MainCalendar .Where(w => w.FSite.Equals(domain)); if (calendars == null) { return; } foreach (var c in calendars) { c.CAlias = Transliteration.Translit(c.CAlias); } }
/// <summary> /// Транслитерирует алиасы для памятных дней /// </summary> /// <param name="domain"></param> public void UpdateMemoryAliases(string domain) { var memories = _db.MainMemory .Where(w => w.FSite.Equals(domain)); if (memories == null) { return; } foreach (var m in memories) { m.CAlias = Transliteration.Translit(m.CAlias); } }
/// <summary> /// Трансилитерирует алиасы для новостей /// </summary> /// <param name="domain"></param> public void UpdateMaterialsAliases(string domain) { var materials = _db.MainMaterials .Where(w => w.FSite.Equals(domain)); if (materials == null) { return; } foreach (var m in materials) { m.CAlias = Transliteration.Translit(m.CAlias); } }