private void ShowRecordOperatorMessage(int code) { try { switch (code) { case RecordOperator.RET_DOWNLOADSERVER_NOT_EXIST: ShowException(CurrentApp.GetLanguageInfo("3103T00167", "Download server not exist.")); break; case RecordOperator.RET_DOWNLOAD_APPSERVER_FAIL: ShowException(CurrentApp.GetLanguageInfo("3103T00166", "Download fail")); break; case RecordOperator.RET_GET_REAL_PASSWORD_FAIL: ShowException(CurrentApp.GetLanguageInfo("3103T00164", "Get real password fail.")); UCPasswordManagement ucPwdMana = new UCPasswordManagement(); ucPwdMana.CurrentApp = CurrentApp; ucPwdMana.PasswordManagerEvent += PasswordManagement_PasswordManagementEvent; ucPwdMana.TaskPage2 = TaskPage2; ucPwdMana.ListUserSettingInfos = ListUserSettingInfos; ucPwdMana.RecordInfoItem = RecordInfoItem; ucPwdMana.ListRecordEncryptInfos = ListEncryptInfo; if (TaskPage2 != null) { TaskPage2.OpenPasswordPanel(ucPwdMana); } break; case RecordOperator.RET_NO_RECORDINFO: ShowException(string.Format("RecordInfo is null")); break; } } catch (Exception ex) { ShowException(ex.Message); } }
private void SetDecryptPassword() { try { if (RecordInfoItem == null) { return; } if (RecordInfoItem.EncryptFlag != "2") { return; } if (ListEncryptInfo == null) { return; } string strServerAddress = RecordInfoItem.VoiceIP; var encryptInfo = ListEncryptInfo.FirstOrDefault(s => s.UserID == CurrentApp.Session.UserID && s.ServerAddress == strServerAddress); if (encryptInfo == null) { encryptInfo = new RecordEncryptInfo(); encryptInfo.UserID = CurrentApp.Session.UserID; encryptInfo.ServerAddress = strServerAddress; encryptInfo.StartTime = DateTime.Now.ToUniversalTime(); encryptInfo.EndTime = DateTime.Now.AddDays(1).ToUniversalTime(); encryptInfo.IsRemember = false; ListEncryptInfo.Add(encryptInfo); } UCPasswordManagement uc = new UCPasswordManagement(); uc.CurrentApp = CurrentApp; uc.PasswordManagerEvent += PasswordManagement_PasswordManagementEvent; uc.ParentPage1 = ParentPage1; uc.ParentPage2 = ParentPage2; uc.TaskPage1 = TaskPage1; uc.TaskPage2 = TaskPage2; uc.ListUserSettingInfos = ListUserSettingInfos; uc.RecordInfoItem = RecordInfoItem; uc.ListRecordEncryptInfos = ListEncryptInfo; if (ParentPage1 != null) { ParentPage1.OpenPasswordPanel(uc); } if (ParentPage2 != null) { ParentPage2.OpenPasswordPanel(uc); } if (TaskPage1 != null) { TaskPage1.OpenPasswordPanel(uc); } if (TaskPage2 != null) { TaskPage2.OpenPasswordPanel(uc); } } catch (Exception ex) { ShowException(ex.Message); } }