InstanceSheets.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 InstanceSheets : PortalPage
  17. {
  18. protected void Page_Load(object sender, System.EventArgs e)
  19. {
  20. string instanceId = System.Web.HttpUtility.UrlDecode(this.Request.QueryString[Param_InstanceId]);
  21. string catalog = System.Web.HttpUtility.UrlDecode(this.Request.QueryString[Param_WorkflowPackage]);
  22. string name = System.Web.HttpUtility.UrlDecode(this.Request.QueryString[Param_WorkflowName]);
  23. string strVersion = System.Web.HttpUtility.UrlDecode(this.Request.QueryString[Param_WorkflowVersion]);
  24. int version = int.Parse(strVersion);
  25.             OThinker.H3.WorkflowTemplate.WorkflowTemplate workflow = OThinker.H3.Server.Engine.WorkflowManager.GetWorkflow(
  26. catalog, 
  27. name, 
  28. version);
  29. string[] sheetNames = null;
  30. if(workflow == null)
  31. {
  32. this.NotifyMessage("该流程不存在!");
  33. }
  34. else if((sheetNames = workflow.SheetNames).Length == 0)
  35. {
  36. this.NotifyMessage("或者没有表单可以查看!");
  37. }
  38.             else if (sheetNames.Length == 1)
  39.             {
  40.                 // 如果只有一个表单,则直接跳转
  41.                 WorkflowTemplate.Sheet defaultSheet = workflow.GetDefaultSheet();
  42.                 string url = null;
  43.                 url = PortalPage.GetViewSheetUrl(defaultSheet, instanceId);
  44.                 this.Response.Redirect(url);
  45.             }
  46.             else
  47.             {
  48.                 int count = 0;
  49.                 for(count=0; count<workflow.Sheets.Length; count++)
  50.                 {
  51.                     if (count > 0)
  52.                     {
  53.                         Label split = new Label();
  54.                         split.Text = " | ";
  55.                         this.panelSheets.Controls.Add(split);
  56.                     }
  57.                     WorkflowTemplate.Sheet sheet = workflow.Sheets[count];
  58.                     HyperLink link = new HyperLink();
  59.                     string url = PortalPage.GetViewSheetUrl(sheet, instanceId);
  60.                     link.Text = sheet.SheetName;
  61.                     link.NavigateUrl = url;
  62.                     this.panelSheets.Controls.Add(link);
  63.                 }
  64.             }
  65. }
  66. #region Web Form Designer generated code
  67. override protected void OnInit(EventArgs e)
  68. {
  69. //
  70. // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  71. //
  72. InitializeComponent();
  73. base.OnInit(e);
  74. }
  75. /// <summary>
  76. /// Required method for Designer support - do not modify
  77. /// the contents of this method with the code editor.
  78. /// </summary>
  79. private void InitializeComponent()
  80. {    
  81. }
  82. #endregion
  83. }
  84. }