コード例 #1
0
        /// <summary>
        /// 判断某个人员是否属于流转模式(判断流程的状态以及人是否在当前活动中)
        /// </summary>
        /// <param name="process"></param>
        /// <param name="originalActivityID"></param>
        /// <param name="userID"></param>
        /// <returns></returns>
        public static bool GetInMoveToMode(this IWfProcess process, string originalActivityID, IUser user)
        {
            bool result = GetInMoveToStatus(process, originalActivityID);

            if (result && user != null)
            {
                result = process.GetInAssignees(originalActivityID, user);
            }

            return(result);
        }
コード例 #2
0
        public WfClientUISwitches FillByProcess(IWfProcess process, string originalActivityID, IUser user)
        {
            if (process != null)
            {
                this.CanMoveTo = process.GetInMoveToMode(originalActivityID, user) ||
                                 (process.GetInMoveToStatus(originalActivityID) && process.GetIsProcessAdmin(user));

                this.CanSave = (process.GetInMoveToMode(originalActivityID, user) && process.CurrentActivity.Descriptor.Properties.GetValue("AllowSave", true)) ||
                               (process.GetInMoveToStatus(originalActivityID) && process.GetIsProcessAdmin(user));

                this.CanPause = process.CanPause && process.GetIsProcessAdmin(user);

                this.CanResume = process.CanResume && process.GetIsProcessAdmin(user);

                this.CanRestore = process.CanRestore && (process.GetInAssignees(originalActivityID, user) || process.GetIsProcessAdmin(user));

                this.CanWithdraw = process.CanWithdraw(user);
                this.CanCancel   = process.CanCancel(originalActivityID, user);
            }

            return(this);
        }