예제 #1
0
파일: Content.cs 프로젝트: fathurxzz/aleqx
 private void SetLang(ContentLang postLang)
 {
     Title = postLang.Title;
     Text = postLang.Text;
     SeoDescription = postLang.SeoDescription;
     SeoKeywords = postLang.SeoKeywords;
 }
예제 #2
0
 private void CreateOrChangeContentLang(SiteContainer context, Content instance, Content cache, Language lang)
 {
    
         ContentLang contenttLang = null;
         if (cache != null)
         {
             contenttLang = context.ContentLang.FirstOrDefault(p => p.ContentId == cache.Id && p.LanguageId == lang.Id);
         }
         if (contenttLang == null)
         {
             var newPostLang = new ContentLang
                                   {
                                       ContentId = instance.Id,
                                       LanguageId = lang.Id,
                                       Title = instance.Title,
                                       Text = HttpUtility.HtmlDecode(instance.Text),
                                       SeoDescription = instance.SeoDescription,
                                       SeoKeywords = instance.SeoKeywords
                                   };
             context.AddToContentLang(newPostLang);
         }
         else
         {
             contenttLang.Title = instance.Title;
             contenttLang.Text = HttpUtility.HtmlDecode(instance.Text);
             contenttLang.SeoDescription = instance.SeoDescription;
             contenttLang.SeoKeywords = instance.SeoKeywords;
         }
         context.SaveChanges();
    
 }
예제 #3
0
 /// <summary>
 /// Create a new ContentLang object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="text">Initial value of the Text property.</param>
 /// <param name="contentId">Initial value of the ContentId property.</param>
 /// <param name="languageId">Initial value of the LanguageId property.</param>
 public static ContentLang CreateContentLang(global::System.Int32 id, global::System.String title, global::System.String text, global::System.Int32 contentId, global::System.Int32 languageId)
 {
     ContentLang contentLang = new ContentLang();
     contentLang.Id = id;
     contentLang.Title = title;
     contentLang.Text = text;
     contentLang.ContentId = contentId;
     contentLang.LanguageId = languageId;
     return contentLang;
 }
예제 #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ContentLang EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToContentLang(ContentLang contentLang)
 {
     base.AddObject("ContentLang", contentLang);
 }