/// <summary>
        /// 根据TrySetLock的结果显示不同的信息
        /// </summary>
        /// <param name="LockOperationResult">操作返回的对象</param>
        /// <returns></returns>
        public static string GetTrySetLockOperationResultDetail(SetLockResult lockResult)
        {
            string result;

            string displayName = GetDisplayName(lockResult.PersonID);

            switch (lockResult.OriginalLockStatus)
            {
                case LockStatus.LockedByAnother:
                    result = string.Format(Resources.TryLockedByAnother, displayName);
                    break;
                case LockStatus.NotLocked:
                    result = Resources.TryNotLocked;
                    break;
                case LockStatus.LockByAnotherAndExpire:
                    result = string.Format(Resources.TryLockByAnotherAndExpire, displayName);
                    break;
                case LockStatus.LockedByRight:
                    result = Resources.TryLockedByRight;
                    break;
                case LockStatus.LockedByRightAndExpire:
                    result = Resources.TryLockedByRightAndExpire;
                    break;
                default:
                    result = string.Empty;
                    break;
            }

            return result;
        }
		/// <summary>
		/// 添加表单锁
		/// </summary>
		/// <param name="formID">表单ID</param>
		/// <param name="activityID">工作流节点ID</param>
		/// <returns>加锁的结果</returns>
		public SetLockResult AddFormLock(string formID, string activityID)
		{
			Lock formLockInfo = new Lock(formID, DeluxeIdentity.CurrentUser.ID);

			SetLockResult finalResult = null;

			using (TransactionScope scope = TransactionScopeFactory.Create())
			{
				SetLockResult formLockResult = LockAdapter.SetLock(formLockInfo);

				if (formLockResult.Succeed == false && formLockResult.OriginalLock.LockType == LockType.AdminLock)
				{
					scope.Complete();

					return formLockResult;
				}

				if (formLockResult.Succeed)
					this._Locks.Add(formLockResult.NewLock);

				Lock activityLockInfo = new Lock(activityID, formID, DeluxeIdentity.CurrentUser.ID);

				activityLockInfo.LockType = LockType.ActivityLock;

				SetLockResult activityLockResult = LockAdapter.SetLock(activityLockInfo);

				if (activityLockResult.Succeed)
					this._Locks.Add(activityLockResult.NewLock);

				if (formLockResult.Succeed)
					finalResult = formLockResult;
				else
					finalResult = activityLockResult;

				scope.Complete();

				this._LockResult = finalResult;

				return finalResult;
			}
		}
		private void SetScene(SetLockResult lockResult)
		{
			bool isReadOnly = true;

			MCS.Library.SOA.DataObjects.OperationType logOpType = MCS.Library.SOA.DataObjects.OperationType.OpenForm;

			if (lockResult != null && lockResult.Succeed && WfClientContext.Current.InMoveToMode && IsRelativeForm == false)
			{
				isReadOnly = false;
				logOpType = MCS.Library.SOA.DataObjects.OperationType.OpenFormForMove;
			}

			//如果流程已经办结,那么检查结束点的场景来决定是否只读
			if (WfClientContext.Current.CurrentActivity != null && WfClientContext.Current.CurrentActivity.Process.Status == WfProcessStatus.Completed)
			{
				isReadOnly = WfClientContext.Current.CurrentActivity.Descriptor.Scene.IsNullOrEmpty();
			}

			if (isReadOnly)
				SetReadOnlyScene(WfClientContext.Current.OriginalActivity);
			else
				SetSceneByActivity(WfClientContext.Current.CurrentActivity);

			WriteOpenFormLog(WfClientContext.Current.CurrentActivity, logOpType);
		}