public ActionResult Edit([Bind(Include = "RuleId,RegularExpression,RegExGroup,Query,RuleStatus,LastUpdateUser")] Data.Rule rule) { if (ModelState.IsValid) { service.Update(rule); return(RedirectToAction("Index")); } return(View(rule)); }
public ActionResult Edit([Bind(Include = "RuleStatus")] Data.Rule rule) { if (ModelState.IsValid) { db.Entry(rule).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(rule)); }
// GET: Approver/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Data.Rule rule = db.Rules.Find(id); if (rule == null) { return(HttpNotFound()); } return(View(rule)); }
// GET: Editor/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Data.Rule rule = service.GetRuleById((int)id); if (rule == null) { return(HttpNotFound()); } return(View(rule)); }
/// <summary> /// 收到更新规则 /// </summary> /// <param name="userName">用户名</param> /// <param name="dataType">数据类型</param> /// <param name="data">规则数据</param> private void RecvUpdateRule(string userName, int dataType, Data.Rule data) { }
public ActionResult DeleteConfirmed(int id) { Data.Rule rule = service.GetRuleById(id); service.Delete(rule); return(RedirectToAction("Index")); }