InstanceSheets.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:3k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Web;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.HtmlControls;
- namespace OThinker.H3.Portal
- {
- /// <summary>
- /// 查看流程的表单
- /// </summary>
- public partial class InstanceSheets : PortalPage
- {
- protected void Page_Load(object sender, System.EventArgs e)
- {
- string instanceId = System.Web.HttpUtility.UrlDecode(this.Request.QueryString[Param_InstanceId]);
- string catalog = System.Web.HttpUtility.UrlDecode(this.Request.QueryString[Param_WorkflowPackage]);
- string name = System.Web.HttpUtility.UrlDecode(this.Request.QueryString[Param_WorkflowName]);
- string strVersion = System.Web.HttpUtility.UrlDecode(this.Request.QueryString[Param_WorkflowVersion]);
- int version = int.Parse(strVersion);
- OThinker.H3.WorkflowTemplate.WorkflowTemplate workflow = OThinker.H3.Server.Engine.WorkflowManager.GetWorkflow(
- catalog,
- name,
- version);
- string[] sheetNames = null;
- if(workflow == null)
- {
- this.NotifyMessage("该流程不存在!");
- }
- else if((sheetNames = workflow.SheetNames).Length == 0)
- {
- this.NotifyMessage("或者没有表单可以查看!");
- }
- else if (sheetNames.Length == 1)
- {
- // 如果只有一个表单,则直接跳转
- WorkflowTemplate.Sheet defaultSheet = workflow.GetDefaultSheet();
- string url = null;
- url = PortalPage.GetViewSheetUrl(defaultSheet, instanceId);
- this.Response.Redirect(url);
- }
- else
- {
- int count = 0;
- for(count=0; count<workflow.Sheets.Length; count++)
- {
- if (count > 0)
- {
- Label split = new Label();
- split.Text = " | ";
- this.panelSheets.Controls.Add(split);
- }
- WorkflowTemplate.Sheet sheet = workflow.Sheets[count];
- HyperLink link = new HyperLink();
- string url = PortalPage.GetViewSheetUrl(sheet, instanceId);
- link.Text = sheet.SheetName;
- link.NavigateUrl = url;
- this.panelSheets.Controls.Add(link);
- }
- }
- }
- #region Web Form Designer generated code
- override protected void OnInit(EventArgs e)
- {
- //
- // CODEGEN: This call is required by the ASP.NET Web Form Designer.
- //
- InitializeComponent();
- base.OnInit(e);
- }
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- }
- #endregion
- }
- }