Exemple #1
0
 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());
 }
Exemple #2
0
        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());
        }