SheetService.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:9k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace OThinker.H3.WorkSheet
- {
- /// <summary>
- /// 服务
- /// </summary>
- public class SheetService
- {
- private System.Web.UI.Page _Page;
- /// <summary>
- /// 对应的表单
- /// </summary>
- public System.Web.UI.Page Page
- {
- get
- {
- return this._Page;
- }
- }
- /// <summary>
- /// 构造函数
- /// </summary>
- /// <param name="Page"></param>
- public SheetService(System.Web.UI.Page Page)
- {
- this._Page = Page;
- }
- #region 服务
- /// <summary>
- /// 使用的组织结构
- /// </summary>
- public virtual OThinker.Organization.IOrganization Organization
- {
- get
- {
- return OThinker.H3.Server.Engine.Organization;
- }
- }
- /// <summary>
- /// 使用的流程管理器
- /// </summary>
- public virtual OThinker.H3.Instance.IInstanceManager InstanceManager
- {
- get
- {
- return OThinker.H3.Server.Engine.InstanceManager;
- }
- }
- /// <summary>
- /// 使用的工作项管理器
- /// </summary>
- public virtual OThinker.H3.WorkItem.IWorkItemManager WorkItemManager
- {
- get
- {
- return OThinker.H3.Server.Engine.WorkItemManager;
- }
- }
- /// <summary>
- /// 流程数据管理器
- /// </summary>
- public virtual OThinker.H3.Data.IInstanceDataManager InstanceDataManager
- {
- get
- {
- return OThinker.H3.Server.Engine.InstanceDataManager;
- }
- }
- /// <summary>
- /// 堆数据管理器
- /// </summary>
- public virtual OThinker.H3.Data.IHeapDataManager HeapDataManager
- {
- get
- {
- return OThinker.H3.Server.Engine.HeapDataManager;
- }
- }
- /// <summary>
- /// 流程模板管理器
- /// </summary>
- public virtual OThinker.H3.WorkflowTemplate.IWorkflowTemplateManager WorkflowManager
- {
- get
- {
- return OThinker.H3.Server.Engine.WorkflowManager;
- }
- }
- /// <summary>
- /// 令牌池
- /// </summary>
- public virtual OThinker.H3.Instance.ITokenPool TokenPool
- {
- get
- {
- return OThinker.H3.Server.Engine.TokenPool;
- }
- }
- #endregion
- #region Web
- /// <summary>
- /// Web服务器的根目录
- /// </summary>
- protected virtual string PortalRoot
- {
- get
- {
- return OThinker.H3.Configs.Config.Current.Web.PortalRoot + "/";
- }
- }
- /// <summary>
- /// 在WEB端显示消息
- /// </summary>
- /// <param name="Message"></param>
- public virtual void NotifyMessage(string Message)
- {
- this.Page.Response.Redirect(this.PortalRoot + "NotifyMessage.aspx" + "?Message=" + System.Web.HttpUtility.UrlEncode(Message));
- }
- /// <summary>
- /// 获得取消流程的URL
- /// </summary>
- /// <param name="InstanceId"></param>
- /// <returns></returns>
- public virtual void CancelInstance(string InstanceId)
- {
- string url = this.PortalRoot + "CancelInstance.aspx" + "?" + "InstanceId" + "=" + InstanceId;
- this.Page.Response.Redirect(url);
- }
- /// <summary>
- /// 获得选择用户的URL
- /// </summary>
- /// <returns></returns>
- public virtual string GetSelectUserUrl()
- {
- return this.PortalRoot + "SelectUser.aspx";
- }
- /// <summary>
- /// 获得选择用户的图片的URL
- /// </summary>
- /// <returns></returns>
- public virtual string GetSelectUserImageUrl()
- {
- return this.PortalRoot + "images/IB_SelectUser.gif";
- }
- /// <summary>
- /// 获得删除用户的图片的URL
- /// </summary>
- /// <returns></returns>
- public virtual string GetRemoveUserImageUrl()
- {
- return this.PortalRoot + "images/IB_Remove.ico";
- }
- /// <summary>
- /// 完成某个工作项
- /// </summary>
- /// <param name="WorkItemID"></param>
- /// <param name="DestActivityName"></param>
- /// <param name="Approval"></param>
- /// <param name="Description"></param>
- public virtual void FinishWorkItem(string WorkItemID, string DestActivityName, string ParticipateGroup, OThinker.Data.BoolMatchValue Approval, string Comment, string Description)
- {
- this.Page.Response.Redirect(this.PortalRoot + "FinishWorkItem.aspx" + "?" +
- "WorkItemID" + "=" + WorkItemID + "&" +
- "DestActivityName" + "=" + System.Web.HttpUtility.UrlEncode(DestActivityName) + "&" +
- "ParticipateGroup=" + System.Web.HttpUtility.UrlEncode(ParticipateGroup) + "&" +
- "Approval" + "=" + Approval.ToString() + "&" +
- "Comment" + "=" + System.Web.HttpUtility.UrlEncode(Comment) + "&" +
- "Description" + "=" + System.Web.HttpUtility.UrlEncode(Description));
- }
- /// <summary>
- /// 获得征询意见的URL
- /// </summary>
- /// <param name="WorkItemID"></param>
- /// <returns></returns>
- public virtual string GetConsultUrl(string WorkItemID)
- {
- string strOption = null;
- if (this.Page is ISheetPage)
- {
- string[] options = ((ISheetPage)this.Page).OptionalConsultants;
- strOption = OThinker.Data.ArrayConvertor<string>.ArrayToString(options);
- }
- return this.PortalRoot + "Consult.aspx" + "?" + "WorkItemID" + "=" + WorkItemID + ((strOption == null) ? null : ("&OptionalConsultants=" + strOption));
- }
- /// <summary>
- /// 获得转发工作项的URL
- /// </summary>
- /// <param name="WorkItemID"></param>
- /// <returns></returns>
- public virtual string GetForwardUrl(string WorkItemID)
- {
- return this.PortalRoot + "Forward.aspx" + "?" + "WorkItemID" + "=" + WorkItemID;
- }
- /// <summary>
- /// 获得查看流程状态的URL
- /// </summary>
- /// <param name="InstanceId"></param>
- /// <returns></returns>
- public virtual string GetViewInstanceStateUrl(string InstanceId)
- {
- return this.PortalRoot + "InstanceStateChart.aspx?InstanceId=" + InstanceId;
- }
- /// <summary>
- /// 获得查看附件的URL
- /// </summary>
- /// <param name="AttachmentID"></param>
- /// <returns></returns>
- public virtual string GetReadAttachment(string AttachmentID)
- {
- return this.PortalRoot + "ReadAttachment.aspx" + "?" + "AttachmentID=" + AttachmentID;
- }
- /// <summary>
- /// 获得删除附件的图片的URL
- /// </summary>
- /// <returns></returns>
- public virtual string GetDeleteAttachmentImageUrl()
- {
- return this.PortalRoot + "images/IB_Remove.ico";
- }
- /// <summary>
- /// 获得取回的URL
- /// </summary>
- /// <param name="WorkItemID"></param>
- /// <returns></returns>
- public virtual string GetRetrieveUrl(string WorkItemID)
- {
- return this.PortalRoot + "RetrieveWorkItem.aspx" + "?" + "WorkItemID=" + WorkItemID;
- }
- #endregion
- #region 当前用户名
- /// <summary>
- /// 获得当前登陆用户
- /// </summary>
- public virtual Portal.UserValidator UserValidator
- {
- get
- {
- return Portal.UserValidatorFactory.GetUserValidator(this.Page);
- }
- }
- /// <summary>
- /// 当前登录用户的ID
- /// </summary>
- public virtual string Participant
- {
- get
- {
- return this.UserValidator.UserID;
- }
- }
- #endregion
- }
- }