public virtual ActionResult Delete(Workflow[] model) { var data = new JsonResultData(ModelState); data.RunWithTry((resultData) => { Manager.Delete(model, Repository); }); return Json(data); }
public virtual ActionResult Delete(Workflow[] model) { var entry = new JsonResultEntry(); try { Manager.Delete(model, Repository); entry.SetSuccess(); } catch (Exception e) { entry.AddException(e); } return Json(entry); }
public virtual ActionResult Edit(Workflow model) { var entry = new JsonResultEntry(); try { int index = 1; foreach (var item in model.Items) { item.Sequence = index; index++; } Manager.Update(Repository, model, model); } catch (Exception e) { entry.AddException(e); } return Json(entry); }
public virtual ActionResult Create(Workflow model, string @return) { var data = new JsonResultData(ModelState); data.RunWithTry((resultData) => { if (model.Items != null) { int index = 1; foreach (var item in model.Items) { item.Sequence = index; index++; } } Manager.Add(Repository, model); resultData.RedirectUrl = @return; }); return Json(data); }