|
- using CnasSynchronousCommon;
- using System;
-
- namespace CnasSynchronusClient
- {
- public class LockStateOperation
- {
- private static readonly string strLocalConfigPath = FileHelper.getBasePath() + @"\Data\";
-
- /// <summary>
- /// 获取表单锁定状态
- /// </summary>
- /// <returns></returns>
- public static bool GetLockState()
- {
- bool isLocked = false;
- try
- {
- string strLocalFileString = FileHelper.GetLocalFile(strLocalConfigPath, "FormLockState.mes");
- if (strLocalFileString != "")
- {
- string strState = EncryptionOperation.Decrypt(strLocalFileString, "NZJXD--CnasClientJXDJXDJ");
- bool.TryParse(strState, out isLocked);
- }
- }
- catch (Exception ex)
- {
- AppLog.Error(ex.Message);
- }
- return isLocked;
- }
-
- /// <summary>
- /// 保存表单锁定状态到本地
- /// </summary>
- /// <param name="isLocked">锁定状态</param>
- /// <returns></returns>
- public static bool SaveLockState(bool isLocked)
- {
- bool bIfSuccess = true;
- try
- {
- string strEncrypString = EncryptionOperation.Encrypt(isLocked.ToString(), "NZJXD--CnasClientJXDJXDJ");
- bIfSuccess = FileHelper.SaveLocalFile(strLocalConfigPath, "FormLockState.mes", strEncrypString);
- }
- catch (Exception ex)
- {
- bIfSuccess = false;
- AppLog.Error(ex.Message);
- }
- return bIfSuccess;
- }
- }
- }
|