예제 #1
0
 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"));
 }
예제 #2
0
        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"));
        }