コード例 #1
0
        public ActionResult Create(AdditionalSurgeries additionalsurgeries)
        {
            if (ModelState.IsValid)
            {
                additionalsurgeries.ID = Guid.NewGuid();
                db.AdditionalSurgeries.Add(additionalsurgeries);
                db.SaveChanges();
                return Content(Boolean.TrueString);
            }

            ViewBag.PracticesID = new SelectList(db.Practices, "ID", "Name", additionalsurgeries.PracticesID);
            return View(additionalsurgeries);
        }
コード例 #2
0
 public ActionResult Edit(AdditionalSurgeries additionalsurgeries)
 {
     if (ModelState.IsValid)
     {
         db.Entry(additionalsurgeries).State = EntityState.Modified;
         db.SaveChanges();
         return Content(Boolean.TrueString);
     }
     ViewBag.PracticesID = new SelectList(db.Practices, "ID", "Name", additionalsurgeries.PracticesID);
     return View(additionalsurgeries);
 }