Ejemplo n.º 1
0
 public ActionResult Edit(PageContents pagecontents)
 {
     if (ModelState.IsValid)
     {
         pagecontents.ChangeTime = DateTime.Now;
         db.PageContents.AddObject(pagecontents);
         db.ObjectStateManager.ChangeObjectState(pagecontents, EntityState.Added);
         //db.PageContents.Attach(pagecontents);
         //db.ObjectStateManager.ChangeObjectState(pagecontents, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Logon", "Account");
     }
     ViewBag.CssClass = new SelectList(db.PageContentClasses, "Id", "ClassName", pagecontents.CssClass);
     //ViewBag.PageId = new SelectList(db.PageRoute, "Id", "PageAddress", pagecontents.PageId);
     return View(pagecontents);
 }
Ejemplo n.º 2
0
        public ActionResult Create(PageContents pagecontents, int pageId)
        {
            pagecontents.PageId = pageId;
            pagecontents.ChangeTime = DateTime.Now;
            pagecontents.PageType = 1;
            if (ModelState.IsValid)
            {
                db.PageContents.AddObject(pagecontents);
                db.SaveChanges();
                return RedirectToAction("Logon", "Account");
            }

            ViewBag.CssClass = new SelectList(db.PageContentClasses, "Id", "ClassName", pagecontents.CssClass);
            ViewBag.PageId = pageId;
            return View(pagecontents);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the PageContents EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPageContents(PageContents pageContents)
 {
     base.AddObject("PageContents", pageContents);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create a new PageContents object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="pageId">Initial value of the PageId property.</param>
 /// <param name="cssClass">Initial value of the CssClass property.</param>
 /// <param name="changeTime">Initial value of the ChangeTime property.</param>
 /// <param name="pageType">Initial value of the PageType property.</param>
 public static PageContents CreatePageContents(global::System.Int32 id, global::System.Int32 pageId, global::System.Int32 cssClass, global::System.DateTime changeTime, global::System.Int32 pageType)
 {
     PageContents pageContents = new PageContents();
     pageContents.Id = id;
     pageContents.PageId = pageId;
     pageContents.CssClass = cssClass;
     pageContents.ChangeTime = changeTime;
     pageContents.PageType = pageType;
     return pageContents;
 }