using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.Entities; using EMIS.ViewModel.SystemView; namespace EMIS.CommonLogic.SystemServices { public class ProcessRelationServices : BaseServices, IProcessRelationServices { /// /// 添加 /// /// 表单ID /// 流程唯一主ID /// 表名 /// public bool ProcessRelationAdd(Guid formID, string InstanceID, string TableName) { try { Sys_ProcessRelation processRelation = new Sys_ProcessRelation(); processRelation.ProcessRelation = Guid.NewGuid(); processRelation.formID = formID; processRelation.InstanceID = InstanceID; processRelation.TableName = TableName; UnitOfWork.Add(processRelation); UnitOfWork.Commit(); return true; } catch (Exception) { throw; } } /// /// 批量添加 /// /// 表单ID /// 流程唯一主ID /// 表名 /// public bool ProcessRelationAdd(IList processRelationList, string TableName) { try { foreach (var processRelation in processRelationList) { Sys_ProcessRelation processRelationEntity = new Sys_ProcessRelation(); processRelationEntity.ProcessRelation = Guid.NewGuid(); processRelationEntity.formID = processRelation.FormID; processRelationEntity.InstanceID = processRelation.InstanceID; processRelationEntity.TableName = TableName; UnitOfWork.Add(processRelationEntity); } UnitOfWork.Commit(); return true; } catch (Exception) { throw; } } } }