InstanceDataTrack.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:5k
源码类别:
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 description for CaseDataTrail.
- /// </summary>
- public partial class InstanceDataTrack : PortalPage
- {
- #region 参数
- private string InstanceId
- {
- get
- {
- return this.Request.QueryString[Param_InstanceId];
- }
- }
- private string ItemName
- {
- get
- {
- string itemName = this.Request.QueryString[Param_ItemName];
- return System.Web.HttpUtility.UrlDecode(itemName);
- }
- }
- private Data.WorkflowDataItem _WorkflowDataItem;
- private Data.WorkflowDataItem WorkflowDataItem
- {
- get
- {
- if (this._WorkflowDataItem == null)
- {
- string package = OThinker.H3.Server.Engine.InstanceManager.GetInstanceWorkflowPackage(this.InstanceId);
- string name = OThinker.H3.Server.Engine.InstanceManager.GetInstanceWorkflowName(this.InstanceId);
- int version = OThinker.H3.Server.Engine.InstanceManager.GetInstanceWorkflowVersion(this.InstanceId);
- WorkflowTemplate.WorkflowTemplate workflow = OThinker.H3.Server.Engine.WorkflowManager.GetWorkflow(package, name, version);
- if (workflow != null)
- {
- this._WorkflowDataItem = workflow.GetDataItem(this.ItemName);
- }
- }
- return this._WorkflowDataItem;
- }
- }
- #endregion
- private System.Data.DataTable TrailTable;
- protected void Page_Load(object sender, System.EventArgs e)
- {
- if (!this.IsPostBack)
- {
- this.lblInstanceID.Text = this.InstanceId.ToString();
- this.lblItemName.Text = this.ItemName;
- this.TrailTable = OThinker.H3.Server.Engine.InstanceDataTrackManager.QueryTable(
- this.InstanceId,
- this.ItemName);
- this.TrailGrid.DataSource = this.TrailTable;
- this.TrailGrid.DataBind();
- }
- }
- #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()
- {
- this.TrailGrid.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.TrailGrid_ItemDataBound);
- }
- #endregion
- private void TrailGrid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
- {
- if (e.Item.ItemType != ListItemType.Header &&
- e.Item.ItemType != ListItemType.Footer)
- {
- int index = e.Item.ItemIndex;
- // 痕迹ID
- string strTrackId = e.Item.Cells[0].Text;
- long trackId = 0;
- try
- {
- trackId = long.Parse(strTrackId);
- }
- catch
- {
- }
- // 修改人
- string modifiedBy = e.Item.Cells[3].Text;
- e.Item.Cells[3].Text = OThinker.H3.Server.Engine.Organization.GetFullName(modifiedBy);
- // 修改值
- object dbOriginalValue = this.TrailTable.Rows[index][OThinker.H3.Data.InstanceDataItemTrack.PropertyName_BinModifiedValue];
- byte[] binOriginalValue;
- if (dbOriginalValue == null || dbOriginalValue == DBNull.Value)
- {
- binOriginalValue = null;
- }
- else
- {
- binOriginalValue = (byte[])dbOriginalValue;
- }
- object originalValue = OThinker.Data.Convertor.ByteArrayToObject(binOriginalValue, false);
- if (originalValue == null)
- {
- e.Item.Cells[4].Text = "null";
- }
- else
- {
- if (OThinker.H3.Data.DataLogicTypeConvertor.IsAttachmentType(this.WorkflowDataItem.LogicType))
- {
- // 是附件类型
- e.Item.Cells[4].Text =
- "<a href="" +
- PageName_ReadAttachment + "?" +
- Param_TrackID + "=" + trackId +
- "">" + "查看附件" + "</a>";
- }
- else
- {
- e.Item.Cells[4].Text = originalValue.ToString();
- }
- }
- }
- }
- }
- }