Beispiel #1
0
        public virtual ActionResult Delete(Workflow[] model)
        {
            var data = new JsonResultData(ModelState);
            data.RunWithTry((resultData) =>
            {
                Manager.Delete(model, Repository);
            });

            return Json(data);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 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);
 }
Beispiel #4
0
        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);
        }