Ejemplo n.º 1
0
 private void SetLang(CategoryBrandItemLang lang)
 {
     Text = lang.Text;
     Title = lang.Title;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a new CategoryBrandItemLang object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="categoryBrandItemId">Initial value of the CategoryBrandItemId property.</param>
 /// <param name="languageId">Initial value of the LanguageId property.</param>
 public static CategoryBrandItemLang CreateCategoryBrandItemLang(global::System.Int32 id, global::System.String title, global::System.Int32 categoryBrandItemId, global::System.Int32 languageId)
 {
     CategoryBrandItemLang categoryBrandItemLang = new CategoryBrandItemLang();
     categoryBrandItemLang.Id = id;
     categoryBrandItemLang.Title = title;
     categoryBrandItemLang.CategoryBrandItemId = categoryBrandItemId;
     categoryBrandItemLang.LanguageId = languageId;
     return categoryBrandItemLang;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the CategoryBrandItemLang EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCategoryBrandItemLang(CategoryBrandItemLang categoryBrandItemLang)
 {
     base.AddObject("CategoryBrandItemLang", categoryBrandItemLang);
 }
Ejemplo n.º 4
0
        private void CreateOrChangeContentLang(SiteContainer context, CategoryBrandItem instance, CategoryBrandItem cache, Language lang)
        {

            CategoryBrandItemLang contenttLang = null;
            if (cache != null)
            {
                contenttLang = context.CategoryBrandItemLang.FirstOrDefault(p => p.CategoryBrandItemId == cache.Id && p.LanguageId == lang.Id);
            }
            if (contenttLang == null)
            {
                var newPostLang = new CategoryBrandItemLang
                {
                    CategoryBrandItemId = instance.Id,
                    LanguageId = lang.Id,
                    Title = instance.Title,
                    Text = HttpUtility.HtmlDecode(instance.Text)
                };
                context.AddToCategoryBrandItemLang(newPostLang);
            }
            else
            {
                contenttLang.Title = instance.Title;
                contenttLang.Text = HttpUtility.HtmlDecode(instance.Text);
            }
            context.SaveChanges();

        }