public ActionResult Create(PointModel pointmodel) { if (ModelState.IsValid) { db.PointModels.Add(pointmodel); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.StageId = new SelectList(db.StageModels, "StageId", "Type", pointmodel.StageId); return View(pointmodel); }
public ActionResult Edit(PointModel pointmodel) { if (ModelState.IsValid) { db.Entry(pointmodel).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.StageId = new SelectList(db.StageModels, "StageId", "Type", pointmodel.StageId); return View(pointmodel); }