public virtual ActionResult AddFlow(WorkFlowView toadd)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var newflow = new WorkFlow();
                    UpdateModel(newflow);
                    //newflow.TaskNodes.Add(new TaskNode {Name="",Description="内置开始节点"});

                    Repository.Add(newflow);
                    Repository.Save();
                    return RedirectToAction(MVC.AppSetting.WorkFlowList(newflow.Id));
                }
                catch
                {
                    return View(toadd);
                }

            }
            ModelState.AddModelError("", "输入不正确");
            return View(toadd);
        }
 public virtual ActionResult EditFlow(int id, WorkFlowView flow)
 {
     if (ModelState.IsValid){
     var toedit = Repository.Single<WorkFlow>(x => x.Id == id);
     TryUpdateModel(toedit);
     Repository.Save();
     return RedirectToAction(MVC.AppSetting.WorkFlowList(id));
     }
     ModelState.AddModelError("", "输入不正确");
     return View(flow);
 }