InstanceDataManager.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:10k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Web;
- using System.Collections;
- using System.Web.Services;
- using System.Web.Services.Protocols;
- /// <summary>
- /// Summary description for InstanceDataManager
- /// </summary>
- [WebService(Namespace = "http://tempuri.org/")]
- [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
- public class InstanceDataManager : System.Web.Services.WebService
- {
- public InstanceDataManager()
- {
- //Uncomment the following line if using designed components
- //InitializeComponent();
- }
- [WebMethod]
- public bool Exist(
- string InstanceId,
- string ItemName)
- {
- return OThinker.H3.Server.Engine.InstanceDataManager.Exist(
- InstanceId,
- ItemName);
- }
- // 获得数据项的值
- [WebMethod]
- public byte[] GetItemValue(
- string InstanceId,
- long TokenID,
- string ItemName)
- {
- object itemValue = OThinker.H3.Server.Engine.InstanceDataManager.GetItemValue(InstanceId, TokenID, ItemName);
- return OThinker.Data.Convertor.ObjectToByteArray(itemValue, false);
- }
- [WebMethod]
- public byte[] GetItemValue2(
- string WorkflowPackage,
- string WorkflowName,
- int WorkflowVersion,
- string InstanceId,
- long TokenID,
- string ItemName,
- string Filler,
- ref object RelatedValue)
- {
- object itemValue = OThinker.H3.Server.Engine.InstanceDataManager.GetItemValue(
- WorkflowPackage,
- WorkflowName,
- WorkflowVersion,
- InstanceId,
- TokenID,
- ItemName,
- Filler,
- ref RelatedValue);
- return OThinker.Data.Convertor.ObjectToByteArray(itemValue, false);
- }
- // 设置值
- [WebMethod]
- public long SetItemValue(
- string InstanceId,
- long TokenID,
- string ItemName,
- string ActivityName,
- string ModifiedBy,
- byte[] SerializedValue)
- {
- object itemValue = OThinker.Data.Convertor.ByteArrayToObject(SerializedValue, false);
- return OThinker.H3.Server.Engine.InstanceDataManager.SetItemValue(
- InstanceId,
- TokenID,
- ItemName,
- ActivityName,
- ModifiedBy,
- itemValue);
- }
- // 追加一个数据
- [WebMethod]
- public long Append(
- string InstanceId,
- long TokenID,
- string ItemName,
- string ActivityName,
- string ModifiedBy,
- byte[] SerializedValue)
- {
- object itemValue = OThinker.Data.Convertor.ByteArrayToObject(SerializedValue, false);
- return OThinker.H3.Server.Engine.InstanceDataManager.Append(
- InstanceId,
- TokenID,
- ItemName,
- ActivityName,
- ModifiedBy,
- itemValue);
- }
- // 创建一个数据集合
- [WebMethod]
- public long CreateItems(string InstanceId)
- {
- return OThinker.H3.Server.Engine.InstanceDataManager.CreateItems(InstanceId);
- }
- // 复制一个数据项
- [WebMethod]
- public long CopyInstanceData(
- string SourceInstanceID,
- long SourceTokenID,
- string SourceItemName,
- string DestInstanceID,
- long DestTokenID,
- string DestItemName)
- {
- return OThinker.H3.Server.Engine.InstanceDataManager.CopyInstanceData(
- SourceInstanceID,
- SourceTokenID,
- SourceItemName,
- DestInstanceID,
- DestTokenID,
- DestItemName);
- }
- // 移除一个数据集合
- [WebMethod]
- public void RemoveInstance(string InstanceId)
- {
- OThinker.H3.Server.Engine.InstanceDataManager.RemoveInstance(InstanceId);
- }
- /// <summary>
- /// 统计信息
- /// </summary>
- /// <param name="WorkflowPackage"></param>
- /// <param name="WorkflowName"></param>
- /// <param name="WorkflowVersion"></param>
- /// <param name="Instances"></param>
- /// <param name="ItemName"></param>
- /// <returns></returns>
- [WebMethod]
- public OThinker.H3.Data.InstanceDataStatistics Stat(
- string WorkflowPackage,
- string WorkflowName,
- int WorkflowVersion,
- string[] Instances,
- string ItemName)
- {
- return OThinker.H3.Server.Engine.InstanceDataManager.Stat(
- WorkflowPackage,
- WorkflowName,
- WorkflowVersion,
- Instances,
- ItemName);
- }
- /// <summary>
- /// 按照关键字来查找流程,查找数据项值略为ItemValue的流程ID集合,该方法使用的时间会比较长
- /// </summary>
- /// <param name="Workflow">所属的流程模板</param>
- /// <param name="ItemName">数据项名称</param>
- /// <param name="ItemValue">数据项值</param>
- /// <param name="Instances">流程范围,只在该范围内进行搜索</param>
- /// <returns>流程ID</returns>
- [WebMethod]
- public string[] Query(
- OThinker.H3.WorkflowTemplate.WorkflowTemplate Workflow,
- string ItemName,
- OThinker.Data.ComparisonOperatorType Operator,
- object ItemValue,
- string[] Instances)
- {
- return OThinker.H3.Server.Engine.InstanceDataManager.Query(Workflow, ItemName, Operator, ItemValue, Instances);
- }
- /// <summary>
- /// 修改一个评论
- /// </summary>
- /// <param name="WorkflowPackage">该评论所属的流程的流程模板的包名称</param>
- /// <param name="WorkflowName">该评论所属的流程的流程模板的名称</param>
- /// <param name="WorkflowVersion">该评论所属的流程的流程模板的版本号</param>
- /// <param name="InstanceId">该评论所属的流程的流程</param>
- /// <param name="ItemName">该评论对应的字段</param>
- /// <param name="CommentID">该评论的ID</param>
- /// <param name="Text">新评论的文本</param>
- /// <param name="Approval">新评论是否标记为同意</param>
- /// <returns>如果找不到该评论则返回ErrorCode.ITEM_NOT_EXIST,否则返回ErrorCode.SUCCESS</returns>
- [WebMethod]
- public long ModifyComment(string InstanceId, string ItemName, string CommentID, string Text, OThinker.Data.BoolMatchValue Approval)
- {
- return OThinker.H3.Server.Engine.InstanceDataManager.ModifyComment(InstanceId, ItemName, CommentID, Text, Approval);
- }
- /// <summary>
- /// 添加一个评论
- /// </summary>
- /// <param name="WorkflowPackage">该评论所属的流程的流程模板的包名称</param>
- /// <param name="WorkflowName">该评论所属的流程的流程模板的名称</param>
- /// <param name="WorkflowVersion">该评论所属的流程的流程模板的版本号</param>
- /// <param name="InstanceId">该评论所属的流程的流程</param>
- /// <param name="ItemName">该评论对应的字段</param>
- /// <param name="Comment"></param>
- [WebMethod]
- public long AddComment(string InstanceId, string ItemName, OThinker.H3.Data.Comment Comment)
- {
- return OThinker.H3.Server.Engine.InstanceDataManager.AddComment(InstanceId, ItemName, Comment);
- }
- /// <summary>
- /// 按照条件查找相应的评论
- /// </summary>
- /// <param name="WorkflowPackage"></param>
- /// <param name="WorkflowName"></param>
- /// <param name="WorkflowVersion"></param>
- /// <param name="InstanceId"></param>
- /// <param name="ItemNames"></param>
- /// <param name="UserID"></param>
- /// <param name="Activity"></param>
- /// <returns></returns>
- [WebMethod]
- public OThinker.H3.Data.Comment[] GetComments(string InstanceId, string[] ItemNames, string UserID, string Activity)
- {
- return OThinker.H3.Server.Engine.InstanceDataManager.GetComments(InstanceId, ItemNames, UserID, Activity);
- }
- /// <summary>
- /// 获得附件
- /// </summary>
- /// <param name="AttachmentID"></param>
- /// <returns></returns>
- [WebMethod]
- public OThinker.H3.Data.Attachment GetAttachment(string AttachmentID)
- {
- return OThinker.H3.Server.Engine.InstanceDataManager.GetAttachment(AttachmentID);
- }
- /// <summary>
- /// 添加附件
- /// </summary>
- /// <param name="Attachment"></param>
- /// <returns></returns>
- [WebMethod]
- public string AddAttachment(OThinker.H3.Data.Attachment Attachment)
- {
- return OThinker.H3.Server.Engine.InstanceDataManager.AddAttachment(Attachment);
- }
- /// <summary>
- /// 删除附件
- /// </summary>
- /// <param name="AttachmentID"></param>
- [WebMethod]
- public void RemoveAttachment(string AttachmentID)
- {
- OThinker.H3.Server.Engine.InstanceDataManager.RemoveAttachment(AttachmentID);
- }
- /// <summary>
- /// 删除流程的所有附件
- /// </summary>
- /// <param name="InstanceId"></param>
- [WebMethod]
- public void RemoveInstanceAttachment(string InstanceId)
- {
- OThinker.H3.Server.Engine.InstanceDataManager.RemoveInstanceAttachment(InstanceId);
- }
- /// <summary>
- /// 查询流程附件的基本信息,不包括附件的内容
- /// </summary>
- /// <param name="InstanceId"></param>
- /// <param name="DataField"></param>
- /// <param name="LastVersion"></param>
- /// <param name="FileName"></param>
- /// <returns></returns>
- [WebMethod]
- public OThinker.H3.Data.AttachmentHeader[] QueryAttachment(string InstanceId, string DataField, OThinker.Data.BoolMatchValue LastVersion, string FileName)
- {
- return OThinker.H3.Server.Engine.InstanceDataManager.QueryAttachment(InstanceId, DataField, LastVersion, FileName);
- }
- }