예제 #1
0
        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);
        }
예제 #2
0
        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);
        }