예제 #1
0
        public ActionResult Create(Param param)
        {
            if (ModelState.IsValid)
            {
                db.Params.Add(param);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.MethodId = new SelectList(db.Methods, "Id", "MethodName", param.MethodId);
            return View(param);
        }
예제 #2
0
 public ActionResult Edit(Param param)
 {
     if (ModelState.IsValid)
     {
         db.Entry(param).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.MethodId = new SelectList(db.Methods, "Id", "MethodName", param.MethodId);
     return View(param);
 }