public ActionResult Insert(グループ_Table model) { try { db.グループ_Table.Add(model); db.SaveChanges(); ModelState.Clear(); ModelState.AddModelError("", "Inserted successful."); } catch { ModelState.AddModelError("", "Inserting failed."); } ViewBag.Items = db.グループ_Table.ToList(); return(View("Index")); }
public ActionResult Update(グループ_Table model) { try { db.Entry(model).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); ModelState.Clear(); ModelState.AddModelError("", "Updated successful!"); } catch { ModelState.AddModelError("", "Updating failed!"); } ViewBag.Items = db.グループ_Table.ToList(); return(View("Index")); }