CNAS取数仪器端升级
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

55 Zeilen
1.7KB

  1. using CnasSynchronousCommon;
  2. using System;
  3. namespace CnasSynchronusClient
  4. {
  5. public class LockStateOperation
  6. {
  7. private static readonly string strLocalConfigPath = FileHelper.getBasePath() + @"\Data\";
  8. /// <summary>
  9. /// 获取表单锁定状态
  10. /// </summary>
  11. /// <returns></returns>
  12. public static bool GetLockState()
  13. {
  14. bool isLocked = false;
  15. try
  16. {
  17. string strLocalFileString = FileHelper.GetLocalFile(strLocalConfigPath, "FormLockState.mes");
  18. if (strLocalFileString != "")
  19. {
  20. string strState = EncryptionOperation.Decrypt(strLocalFileString, "NZJXD--CnasClientJXDJXDJ");
  21. bool.TryParse(strState, out isLocked);
  22. }
  23. }
  24. catch (Exception ex)
  25. {
  26. AppLog.Error(ex.Message);
  27. }
  28. return isLocked;
  29. }
  30. /// <summary>
  31. /// 保存表单锁定状态到本地
  32. /// </summary>
  33. /// <param name="isLocked">锁定状态</param>
  34. /// <returns></returns>
  35. public static bool SaveLockState(bool isLocked)
  36. {
  37. bool bIfSuccess = true;
  38. try
  39. {
  40. string strEncrypString = EncryptionOperation.Encrypt(isLocked.ToString(), "NZJXD--CnasClientJXDJXDJ");
  41. bIfSuccess = FileHelper.SaveLocalFile(strLocalConfigPath, "FormLockState.mes", strEncrypString);
  42. }
  43. catch (Exception ex)
  44. {
  45. bIfSuccess = false;
  46. AppLog.Error(ex.Message);
  47. }
  48. return bIfSuccess;
  49. }
  50. }
  51. }