public ActionResult Create(Step step) { if (ModelState.IsValid) { step.ID = Guid.NewGuid(); db.Steps.Add(step); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.FlowID = new SelectList(db.Flows, "ID", "Name", step.FlowID); ViewBag.StepTypeID = new SelectList(db.StepTypes, "ID", "Name", step.StepTypeID); return View(step); }
public ActionResult Edit(Step step) { if (ModelState.IsValid) { db.Entry(step).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.FlowID = new SelectList(db.Flows, "ID", "Name", step.FlowID); ViewBag.StepTypeID = new SelectList(db.StepTypes, "ID", "Name", step.StepTypeID); return View(step); }