Ejemplo n.º 1
0
 public ActionResult Edit(Content model)
 {
     var article = _context.UserArticle.First(c => c.Id == model.Id);
     article.Name = Utils.Transliterator.Transliterate( model.Name);
     article.Title = model.Title;
     article.Text = HttpUtility.HtmlDecode(model.Text);
     _context.SaveChanges();
     return RedirectToAction("Index");
 }
Ejemplo n.º 2
0
 public ActionResult Edit(Content model)
 {
     var content = _context.Content.First(c => c.Id == model.Id);
     content.Title = model.Title;
     content.Text = HttpUtility.HtmlDecode(model.Text);
     content.SeoDescription = model.SeoDescription;
     content.SeoKeywords = model.SeoKeywords;
     _context.SaveChanges();
     return RedirectToAction("SiteContent", "Home", new { area = "", id = content.Name });
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Content EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToContent(Content content)
 {
     base.AddObject("Content", content);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create a new Content object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="mainPage">Initial value of the MainPage property.</param>
 public static Content CreateContent(global::System.Int32 id, global::System.String name, global::System.String title, global::System.Boolean mainPage)
 {
     Content content = new Content();
     content.Id = id;
     content.Name = name;
     content.Title = title;
     content.MainPage = mainPage;
     return content;
 }