/// <summary> /// 绑定第一层Repeater,这个是SysActivityInstance /// </summary> private void BindrpActivityInstance() { var pi = this.PI; if (pi != null && pi.Process.ProcessCategory == (int)ProcessCategory.Approve) { var result = pi.ActivityInstances.Where(p => p.Activity.ActivityType == (int)ActivityType.Approve) .OrderBy(p => p.StartTime) .Select(p => new { p.StartTime, ActivityId = p.ActivityId, ActivityName = p.Activity.ActivityName, ActivityInstanceId = p.ActivityInstanceId, AI = p, }).ToList().Select(p => new { p.AI, p.StartTime, p.ActivityId, p.ActivityName, p.ActivityInstanceId, ApproveResult = GetCheckState(p.AI), }).Distinct(); this.rpActivityInstance.DataSource = result.OrderBy(p => p.StartTime).ToList(); this.rpActivityInstance.DataBind(); this.divHistory.Visible = true; PICache.ClearCache(this.ProcessInstanceId); } else { this.divHistory.Visible = false; } }
/// <summary> /// 加载数据 /// </summary> void LoadData() { this.TracerBackground = System.Configuration.ConfigurationManager.AppSettings[ConstKey.ProcessDetailBackground]; if (string.IsNullOrEmpty(this.TracerBackground)) { this.TracerBackground = "E8E8E8"; } string id = Request.QueryString["id"]; if (!string.IsNullOrEmpty(id)) { int piid = int.Parse(id); using (BizDataContext context = new BizDataContext()) { this.PICache = new ProcessInstanceCacheFactory(context); this.PI = PICache.GetProcessInstanceCache(piid); var data = this.PI; lblProcessName.Text = data.Process.ProcessName; var startUser = context.FindById <T_User>(data.StartUserId); var startDept = context.FindById <T_Department>(data.StartDeptId); if (startUser != null) { lblStartUser.Text = startUser.User_Name; } if (startDept != null) { lblStartDept.Text = startDept.Department_Name; } if (data.StartTime.HasValue) { lblStartTime.Text = data.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); } if (data.EndTime.HasValue) { lblEndTime.Text = data.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); } lblStatus.Text = GetStatusName(data.InstanceStatus); this.ProcessInstanceId = data.ProcessInstanceId; int objectId = data.ObjectId; string entityName = data.Process.ProcessEntity.EntityName; string displayValue = (new OrgManager(context)).GetDisplayValue(entityName, objectId); lblObject.Text = displayValue; } } }