public ActionResult Create(PrEntry prentry)
        {
            if (ModelState.IsValid)
            {
                db.PrEntries.AddObject(prentry);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.worldid = new SelectList(db.PrWorlds, "worldid", "worldname", prentry.worldid);
            return View(prentry);
        }
 public ActionResult Edit(PrEntry prentry)
 {
     if (ModelState.IsValid)
     {
         db.PrEntries.Attach(prentry);
         db.ObjectStateManager.ChangeObjectState(prentry, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Details", new { id = prentry.entryid });
     }
     ViewBag.worldid = new SelectList(db.PrWorlds, "worldid", "worldname", prentry.worldid);
     return View(prentry);
 }
示例#3
0
 /// <summary>
 /// Create a new PrEntry object.
 /// </summary>
 /// <param name="entryid">Initial value of the entryid property.</param>
 /// <param name="name">Initial value of the name property.</param>
 /// <param name="worldid">Initial value of the worldid property.</param>
 /// <param name="type">Initial value of the type property.</param>
 public static PrEntry CreatePrEntry(global::System.Int32 entryid, global::System.String name, global::System.Int32 worldid, global::System.Byte type)
 {
     PrEntry prEntry = new PrEntry();
     prEntry.entryid = entryid;
     prEntry.name = name;
     prEntry.worldid = worldid;
     prEntry.type = type;
     return prEntry;
 }
示例#4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the PrEntries EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPrEntries(PrEntry prEntry)
 {
     base.AddObject("PrEntries", prEntry);
 }