コード例 #1
0
 public ActionResult Edit(CustomerGroup customergroup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customergroup).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(customergroup);
 }
コード例 #2
0
        public ActionResult Create(CustomerGroup customergroup)
        {
            if (ModelState.IsValid)
            {
                db.CustomerGroups.Add(customergroup);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(customergroup);
        }