Esempio n. 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);
        }
Esempio n. 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);
 }