Пример #1
0
        public static string CheckLockResultToMessage(AMSCheckLockResult checkResult)
        {
            checkResult.NullCheck("checkResult");

            StringBuilder strB = new StringBuilder();

            strB.AppendFormat("申请{0}失败。", EnumItemDescriptionAttribute.GetDescription(checkResult.Lock.LockType));

            if (checkResult.Lock.LockPersonName.IsNotEmpty())
                strB.AppendFormat("正在由\"{0}\"执行\"{1}\"。", checkResult.Lock.LockPersonName, checkResult.Lock.Description);
            else
                strB.AppendFormat("正在执行\"{0}\"", checkResult.Lock.Description);

            strB.Append("请稍后再尝试。");

            return strB.ToString();
        }
Пример #2
0
        public static string CheckLockResultToMessage(AMSCheckLockResult checkResult)
        {
            checkResult.NullCheck("checkResult");

            StringBuilder strB = new StringBuilder();

            strB.AppendFormat("申请{0}失败。", EnumItemDescriptionAttribute.GetDescription(checkResult.Lock.LockType));

            if (checkResult.Lock.LockPersonName.IsNotEmpty())
            {
                strB.AppendFormat("正在由\"{0}\"执行\"{1}\"。", checkResult.Lock.LockPersonName, checkResult.Lock.Description);
            }
            else
            {
                strB.AppendFormat("正在执行\"{0}\"", checkResult.Lock.Description);
            }

            strB.Append("请稍后再尝试。");

            return(strB.ToString());
        }
Пример #3
0
        private static AMSCheckLockResult BuildNotAvailableResult(AMSLock lockData)
        {
            AMSCheckLockResult result = new AMSCheckLockResult();

            result.Lock = lockData;
            result.LockStatus = AMSCheckLockStatus.Locked;

            return result;
        }
Пример #4
0
        private static AMSCheckLockResult BuildAvailableResult(AMSLock lockData, bool overrideLock)
        {
            AMSCheckLockResult result = new AMSCheckLockResult();

            result.Lock = lockData;

            if (overrideLock)
                result.LockStatus = AMSCheckLockStatus.LockExpired;
            else
                result.LockStatus = AMSCheckLockStatus.NotLocked;

            return result;
        }