EditInstanceData.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:4k
源码类别:
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 EditInstanceData : PortalPage
- {
- #region 参数
- public string InstanceId
- {
- get
- {
- return this.Request.QueryString[Param_InstanceId];
- }
- }
- private string _WorkflowPackage = null;
- public string WorkflowPackage
- {
- get
- {
- if (this._WorkflowPackage == null)
- {
- this._WorkflowPackage = OThinker.H3.Server.Engine.InstanceManager.GetInstanceWorkflowPackage(this.InstanceId);
- }
- return this._WorkflowPackage;
- }
- }
- private string _WorkflowName = null;
- public string WorkflowName
- {
- get
- {
- if (this._WorkflowName == null)
- {
- this._WorkflowName = OThinker.H3.Server.Engine.InstanceManager.GetInstanceWorkflowName(this.InstanceId);
- }
- return this._WorkflowName;
- }
- }
- private int _WorkflowVersion = H3.WorkflowTemplate.WorkflowTemplate.NullWorkflowVersion;
- public int WorkflowVersion
- {
- get
- {
- if (this._WorkflowVersion == H3.WorkflowTemplate.WorkflowTemplate.NullWorkflowVersion)
- {
- this._WorkflowVersion = OThinker.H3.Server.Engine.InstanceManager.GetInstanceWorkflowVersion(this.InstanceId);
- }
- return this._WorkflowVersion;
- }
- }
- private H3.WorkflowTemplate.WorkflowTemplate _Workflow = null;
- public H3.WorkflowTemplate.WorkflowTemplate Workflow
- {
- get
- {
- if (this._Workflow == null)
- {
- this._Workflow = OThinker.H3.Server.Engine.WorkflowManager.GetWorkflow(this.WorkflowPackage, this.WorkflowName, this.WorkflowVersion);
- }
- return this._Workflow;
- }
- }
- private string _ItemName = null;
- public string ItemName
- {
- get
- {
- if (this._ItemName == null)
- {
- this._ItemName = HttpUtility.UrlDecode(this.Request.QueryString[Param_ItemName]);
- }
- return this._ItemName;
- }
- }
- public H3.Data.WorkflowDataItem WorkflowDataItem
- {
- get
- {
- return this.Workflow.GetDataItem(this.ItemName);
- }
- }
- #endregion
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!this.IsPostBack)
- {
- // 验证是否具有管理员权限
- if (!this.UserValidator.ValidateAdministrator())
- {
- this.NotifyMessage(LackOfAuth);
- }
- // 获得当前值
- object currentValue = OThinker.H3.Server.Engine.InstanceDataManager.GetItemValue(this.InstanceId, Instance.Token.UnspecifiedID, this.ItemName);
- if (currentValue == null)
- {
- this.txtItemValue.Text = "";
- }
- else
- {
- this.txtItemValue.Text = currentValue.ToString();
- }
- }
- }
- protected void btnSubmit_Click(object sender, EventArgs e)
- {
- object newValue = OThinker.Data.Convertor.Convert(this.txtItemValue.Text, this.WorkflowDataItem.RealType);
- OThinker.H3.Server.Engine.InstanceDataManager.SetItemValue(this.InstanceId, Instance.Token.UnspecifiedID, this.ItemName, null, this.UserValidator.UserID, newValue);
- this.NotifyMessage("值修改成功");
- }
- }
- }