EnabledActivity.aspx.cs
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:3k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Collections;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Web;
  7. using System.Web.SessionState;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.HtmlControls;
  11. namespace OThinker.H3.Portal
  12. {
  13. /// <summary>
  14. /// 显示某个流程实例当前活动的任务的接受人员
  15. /// </summary>
  16.     public partial class EnabledActivity : PortalPage
  17. {
  18. protected void Page_Load(object sender, System.EventArgs e)
  19. {
  20. if(!this.IsPostBack)
  21. {
  22. // 获得ID
  23. string instanceId = this.Request.QueryString[Param_InstanceId];
  24. System.Data.DataTable receiverTable = new DataTable();
  25. receiverTable.Columns.Add("Activity");
  26. receiverTable.Columns.Add("Receivers");
  27.                 OThinker.H3.Instance.InstanceContext entity = OThinker.H3.Server.Engine.InstanceManager.GetInstanceContext(instanceId);
  28. if(entity != null)
  29. {
  30. foreach(string activity in entity.EnabledActivities)
  31. {
  32. if(activity == null || activity == "")
  33. {
  34. continue;
  35. }
  36. string receivers = null;
  37. // 查找该任务对应的接收人
  38.                         string[] jobIds = OThinker.H3.Server.Engine.WorkItemManager.Query(
  39.                             activity,
  40.                             new string[] { instanceId },
  41.                             null,
  42.                             System.DateTime.MinValue,
  43.                             System.DateTime.MaxValue,
  44.                             OThinker.H3.WorkItem.WorkItemState.Unfinished);
  45. if(jobIds != null)
  46. {
  47.                             foreach (string jobId in jobIds)
  48. {
  49. OThinker.H3.WorkItem.WorkItem job = OThinker.H3.Server.Engine.WorkItemManager.GetWorkItem(jobId);
  50. string receiver = OThinker.H3.Server.Engine.Organization.GetFullName(job.Participant);
  51. receivers += receiver + "<BR>";
  52. }
  53. }
  54. receiverTable.Rows.Add(
  55. new object[]{
  56. activity, 
  57. receivers});
  58. }
  59. }
  60. this.ReceiverGrid.DataSource = receiverTable;
  61. this.ReceiverGrid.DataBind();
  62. }
  63. }
  64. #region Web Form Designer generated code
  65. override protected void OnInit(EventArgs e)
  66. {
  67. //
  68. // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  69. //
  70. InitializeComponent();
  71. base.OnInit(e);
  72. }
  73. /// <summary>
  74. /// Required method for Designer support - do not modify
  75. /// the contents of this method with the code editor.
  76. /// </summary>
  77. private void InitializeComponent()
  78. {    
  79. }
  80. #endregion
  81. }
  82. }