コード例 #1
0
        public ActionResult Create(MedicalType medicaltype)
        {
            if (ModelState.IsValid)
            {
                medicaltype.id = Guid.NewGuid();
                db.MedicalTypes.Add(medicaltype);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

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