コード例 #1
0
        public ActionResult Create(CustomersCardType customerscardtype)
        {
            if (ModelState.IsValid)
            {
                db.CustomersCardTypes.Add(customerscardtype);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(customerscardtype);
        }
コード例 #2
0
 public ActionResult Edit(CustomersCardType customerscardtype)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customerscardtype).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(customerscardtype);
 }