// // GET: /Wiki/Create/name public ActionResult Create(string Title) { if (!User.Identity.IsAuthenticated) { return RedirectToAction("Index"); } Article a = new Article(); a.Title = Title; Article_section sec = new Article_section(); //sec.Pub_date = DateTime.Now; a.Article_section.Add(sec); return View(a); }
public ActionResult Edit(int Section) { Console.WriteLine("ej"); if (!User.Identity.IsAuthenticated) { return RedirectToAction("Account", "LogOn"); } Article_section sec = new Article_section(); try { var section = from art in db.Article_section where art.Id == Section select art; sec = section.ToArray()[0]; } catch (IndexOutOfRangeException) { return RedirectToAction("/Edit/" + Section); } return View(sec); }
/// <summary> /// Create a new Article_section object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="article_id">Initial value of the Article_id property.</param> /// <param name="user_name">Initial value of the User_name property.</param> public static Article_section CreateArticle_section(global::System.Int32 id, global::System.Int32 article_id, global::System.String user_name) { Article_section article_section = new Article_section(); article_section.Id = id; article_section.Article_id = article_id; article_section.User_name = user_name; return article_section; }
/// <summary> /// Deprecated Method for adding a new object to the Article_section EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToArticle_section(Article_section article_section) { base.AddObject("Article_section", article_section); }