示例#1
0
        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);
        }
示例#2
0
 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);
 }