public ActionResult Create(FlowItRule FlowItRule) { if (ModelState.IsValid) { db.FlowItRules.Add(FlowItRule); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.OrganizationId = new SelectList(db.Organizations, "Id", "Name", FlowItRule.OrganizationId); ViewBag.CriteriaId = new SelectList(db.Criterias, "Id", "Name", FlowItRule.CriteriaId); ViewBag.CriteriaItemId = new SelectList(db.CriteriaItems, "Id", "Name", FlowItRule.CriteriaItemId); return View(FlowItRule); }
public ActionResult Edit(FlowItRule FlowItRule) { if (ModelState.IsValid) { db.Entry(FlowItRule).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.OrganizationId = new SelectList(db.Organizations, "Id", "Name", FlowItRule.OrganizationId); ViewBag.CriteriaId = new SelectList(db.Criterias, "Id", "Name", FlowItRule.CriteriaId); ViewBag.CriteriaItemId = new SelectList(db.CriteriaItems, "Id", "Name", FlowItRule.CriteriaItemId); return View(FlowItRule); }