StartInstanceSps.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:6k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- namespace OThinker.H3.Portal
- {
- public partial class StartInstanceSps : PortalPage
- {
- protected string WorkflowPackage
- {
- get
- {
- return HttpUtility.UrlDecode(this.Request.QueryString[Param_WorkflowPackage]);
- }
- }
- protected string WorkflowName
- {
- get
- {
- return HttpUtility.UrlDecode(this.Request.QueryString[Param_WorkflowName]);
- }
- }
- private int _WorkflowVersion = WorkflowTemplate.WorkflowTemplate.NullWorkflowVersion;
- protected int WorkflowVersion
- {
- get
- {
- if (this._WorkflowVersion == WorkflowTemplate.WorkflowTemplate.NullWorkflowVersion)
- {
- string strVersion = this.Request.QueryString[Param_WorkflowVersion];
- if (strVersion == null || strVersion == "")
- {
- this._WorkflowVersion = OThinker.H3.Server.Engine.WorkflowManager.GetWorkflowDefaultVersion(this.WorkflowPackage, this.WorkflowName);
- }
- else
- {
- this._WorkflowVersion = int.Parse(strVersion);
- }
- }
- return this._WorkflowVersion;
- }
- }
- protected string InstanceName
- {
- get
- {
- return this.Request.QueryString[Param_InstanceName];
- }
- }
- protected OThinker.H3.Instance.PriorityType Priority
- {
- get
- {
- string strPriority = this.Request.QueryString[Param_Priority];
- if (strPriority == null || strPriority == "")
- {
- return OThinker.H3.Instance.PriorityType.Normal;
- }
- else
- {
- return OThinker.H3.Instance.PriorityTypeConvertor.ToPriorityType(strPriority);
- }
- }
- }
- protected string SpsSite
- {
- get
- {
- return HttpUtility.UrlDecode(this.Request.QueryString[Instance.InstanceContext.PropertyName_SpsSite]);
- }
- }
- protected string SpsWebName
- {
- get
- {
- return HttpUtility.UrlDecode(this.Request.QueryString[Instance.InstanceContext.PropertyName_SpsWebName]);
- }
- }
- protected string SpsList
- {
- get
- {
- return HttpUtility.UrlDecode(this.Request.QueryString[Instance.InstanceContext.PropertyName_SpsList]);
- }
- }
- protected int SpsListItemId
- {
- get
- {
- return int.Parse(HttpUtility.UrlDecode(this.Request.QueryString[Instance.InstanceContext.PropertyName_SpsListItemId]));
- }
- }
- protected string OriginateRole
- {
- get
- {
- return this.Request.QueryString[Param_OriginateRole];
- }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- string[] groups = null;
- if (this.OriginateRole != null && this.OriginateRole != "")
- {
- this.Originate(this.OriginateRole);
- }
- else if ((groups = OThinker.H3.Server.Engine.Organization.GetParentGroups(this.UserValidator.UserID)) == null || groups.Length == 0)
- {
- this.Originate(null);
- }
- else if(groups.Length == 0)
- {
- this.Originate(groups[0]);
- }
- else
- {
- foreach (string group in groups)
- {
- string groupPath = OThinker.H3.Server.Engine.Organization.GetFullName(group);
- this.lstOriginateRole.Items.Add(new ListItem(groupPath, group));
- }
- }
- }
- private void Originate(string OriginateRole)
- {
- // Parameters
- System.Collections.Generic.Dictionary<string, object> instanceParamter = new System.Collections.Generic.Dictionary<string, object>();
- instanceParamter.Add(Instance.InstanceContext.PropertyName_SpsSite, this.SpsSite);
- instanceParamter.Add(Instance.InstanceContext.PropertyName_SpsWebName, this.SpsWebName);
- instanceParamter.Add(Instance.InstanceContext.PropertyName_SpsList, this.SpsList);
- instanceParamter.Add(Instance.InstanceContext.PropertyName_SpsListItemId, this.SpsListItemId);
- // 发起流程
- string itemId = base.OriginateInstance(this.WorkflowPackage, this.WorkflowName, this.WorkflowVersion, this.Priority, null, null, instanceParamter);
- OThinker.H3.WorkItem.WorkItem item = OThinker.H3.Server.Engine.WorkItemManager.GetWorkItem(itemId);
- this.Response.Redirect(PortalPage.GetWorkSheetUrl(item));
- }
- protected void lnkSubmit_Click(object sender, EventArgs e)
- {
- string group = this.lstOriginateRole.SelectedValue;
- this.Originate(group);
- }
- }
- }