/// <summary> /// 保存绑定流程信息 /// </summary> /// <param name="entity"></param> public void SaveEntityProcess(EntityProcessEntity entity) { var entityDefID = entity.EntityDefID; var sql = @"DELETE FROM EavEntityProcess WHERE EntityDefID=@entityDefID"; var session = SessionFactory.CreateSession(); try { session.BeginTrans(); QuickRepository.Execute(session.Connection, sql, new { entityDefID = entityDefID }, session.Transaction); QuickRepository.Insert <EntityProcessEntity>(session.Connection, entity, session.Transaction); session.Commit(); } catch (System.Exception ex) { session.Rollback(); throw; } finally { session.Dispose(); } }
public ResponseResult SaveEntityProcess(EntityProcessEntity entity) { var result = ResponseResult.Default(); try { FBMasterService.SaveEntityProcess(entity); result = ResponseResult.Success(); } catch (System.Exception ex) { result = ResponseResult.Error( string.Format("表单绑定流程数据失败!{0}", ex.Message) ); } return(result); }
/// <summary> /// 获取表单绑定流程信息 /// </summary> /// <param name="entityDefID"></param> /// <returns></returns> public EntityProcessEntity GetEntityProcess(int entityDefID) { EntityProcessEntity entity = null; var sql = @"SELECT * FROM EavEntityProcess ED WHERE EntityDefID=@entityDefID"; var list = QuickRepository.Query <EntityProcessEntity>(sql, new { entityDefID = entityDefID }).ToList(); if (list != null && list.Count() == 1) { entity = list[0]; } return(entity); }