Esempio n. 1
0
 private ActionResult EditCore(Flow entity)
 {
     return View("Edit", entity);
 }
Esempio n. 2
0
 /// <summary>
 /// 检测是否存在指定流程
 /// </summary>
 /// <param name="entity">流程实体</param>
 /// <returns>存在返回true</returns>
 public BoolMessage Exists(Flow entity)
 {
     var has = repos.Exists(p => p.Name == entity.Name && p.Category == entity.Category && p.Id != entity.Id);
     return has ? new BoolMessage(false, "输入流程名称已经存在") : BoolMessage.True;
 }
Esempio n. 3
0
        public ActionResult Save(Flow entity)
        {
            var hasResult = service.Exists(entity);
            if (hasResult.Failure)
            {
                return Json(hasResult);
            }

            var result = string.IsNullOrEmpty(entity.Id) ? service.Insert(entity) : service.Update(entity);
            return Json(result);
        }
Esempio n. 4
0
 /// <summary>
 /// 更新流程
 /// </summary>
 /// <param name="entity">流程实体</param>
 public BoolMessage Update(Flow entity)
 {
     try
     {
         repos.Update(entity);
         return BoolMessage.True;
     }
     catch (Exception e)
     {
         return new BoolMessage(false, e.Message);
     }
 }