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

            return View(equipmenttype);
        }