1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- 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
- {
- /// <summary>
- /// 添加
- /// </summary>
- /// <param name="formID">表单ID</param>
- /// <param name="InstanceID">流程唯一主ID</param>
- /// <param name="TableName">表名</param>
- /// <returns></returns>
- 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;
- }
- }
- /// <summary>
- /// 批量添加
- /// </summary>
- /// <param name="formID">表单ID</param>
- /// <param name="InstanceID">流程唯一主ID</param>
- /// <param name="TableName">表名</param>
- /// <returns></returns>
- public bool ProcessRelationAdd(IList<BaseProcessRelationView> 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;
- }
- }
- }
- }
|