public ActionResult Update(Group動詞 group) { try { db.Entry(group).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); ModelState.Clear(); ModelState.AddModelError("", "Updated successful!"); } catch { ModelState.AddModelError("", "Updating failed!"); } ViewBag.Group動詞 = db.Group動詞.ToList(); return(View()); }
public ActionResult Insert(Group動詞 group) { try { db.Group動詞.Add(group); db.SaveChanges(); ModelState.AddModelError("", "Inserted successful."); ModelState.Clear(); } catch { ModelState.AddModelError("", "Inserting failed."); ModelState.Clear(); } ViewBag.Group動詞 = db.Group動詞.ToList(); return(View()); }