Пример #1
0
        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);
        }
Пример #2
0
 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);
 }