public ActionResult Create(Transition transition) { if (ModelState.IsValid) { transition.ID = Guid.NewGuid(); db.Transitions.Add(transition); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.FromStepID = new SelectList(db.Steps, "ID", "ID", transition.FromStepID); ViewBag.ToStepID = new SelectList(db.Steps, "ID", "ID", transition.ToStepID); ViewBag.TranistionTypeID = new SelectList(db.TransitionTypes, "ID", "Name", transition.TranistionTypeID); return View(transition); }
public ActionResult Edit(Transition transition) { if (ModelState.IsValid) { db.Entry(transition).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.FromStepID = new SelectList(db.Steps, "ID", "ID", transition.FromStepID); ViewBag.ToStepID = new SelectList(db.Steps, "ID", "ID", transition.ToStepID); ViewBag.TranistionTypeID = new SelectList(db.TransitionTypes, "ID", "Name", transition.TranistionTypeID); return View(transition); }