/// <summary> /// 更新状态信息 /// </summary> public void UpdateState() { if (Info == null) { return; } switch (ObjType) { case ConstValue.RESOURCE_AGENT: case ConstValue.RESOURCE_EXTENSION: if (Info.ChanObjID <= 0) { LoginState = LoginState.LogOff; CallState = CallState.Idle; RecordState = RecordState.None; } else { if (ChanState != null) { Extension = ChanState.Extension; AgentID = ChanState.AgentID; LoginState = ChanState.LoginState; CallState = ChanState.CallState; RecordState = ChanState.RecordState; RecordReference = ChanState.RecordReference; DirectionFlag = ChanState.DirectionFlag; CallerID = ChanState.CallerID; CalledID = ChanState.CalledID; StartRecordTime = ChanState.StartRecordTime; StopRecordTime = ChanState.StopRecordTime; DealRecordLength(ChanState); } } break; } StrIcon = Icon; StrLoginState = LoginState == LoginState.LogOff ? string.Empty : App.GetLanguageInfo( string.Format("BID{0}{1}", S2102Consts.BID_LOGSTATE, ((int)LoginState).ToString("000")), LoginState.ToString()); StrCallState = CallState == CallState.Idle ? string.Empty : App.GetLanguageInfo( string.Format("BID{0}{1}", S2102Consts.BID_CALLSTATE, ((int)CallState).ToString("000")), CallState.ToString()); StrRecordState = RecordState == RecordState.None ? string.Empty : App.GetLanguageInfo( string.Format("BID{0}{1}", S2102Consts.BID_RECORDSTATE, ((int)RecordState).ToString("000")), RecordState.ToString()); StrDirection = DirectionFlag == 1 ? App.GetLanguageInfo("2102014", "Callin") : App.GetLanguageInfo("2102015", "Callout"); StrStartRecordTime = StartRecordTime > DateTime.Parse("2014/1/1") ? StartRecordTime.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss") : string.Empty; StrStopRecordTime = StopRecordTime > DateTime.Parse("2014/1/1") ? StopRecordTime.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss") : string.Empty; StrRecordLength = RecordLength > 0 ? Converter.Second2Time(RecordLength) : "00:00:00"; Background = Brushes.Transparent; if (LoginState == LoginState.LogOn) { Background = Brushes.Wheat; if (ListUserParams != null) { var userParam = ListUserParams.FirstOrDefault(p => p.ParamID == S2102Consts.UP_COLOR_VOCLOGINSTATE); if (userParam != null) { try { Color color = Utils.GetColorFromRgbString(userParam.ParamValue); Background = new SolidColorBrush(color); } catch { } } } } if (RecordState == RecordState.Recoding) { Background = Brushes.Thistle; if (DirectionFlag == 1) { Background = Brushes.Thistle; } else { Background = Brushes.Violet; } if (ListUserParams != null) { var userParam = ListUserParams.FirstOrDefault(p => p.ParamID == S2102Consts.UP_COLOR_VOCRECORDSTATE); if (userParam != null) { try { Color color = Utils.GetColorFromRgbString(userParam.ParamValue); Background = new SolidColorBrush(color); } catch { } } if (DirectionFlag == 1) { userParam = ListUserParams.FirstOrDefault(p => p.ParamID == S2102Consts.UP_COLOR_CALLINSTATE); if (userParam != null) { try { Color color = Utils.GetColorFromRgbString(userParam.ParamValue); Background = new SolidColorBrush(color); } catch { } } } else { userParam = ListUserParams.FirstOrDefault(p => p.ParamID == S2102Consts.UP_COLOR_CALLOUTSTATE); if (userParam != null) { try { Color color = Utils.GetColorFromRgbString(userParam.ParamValue); Background = new SolidColorBrush(color); } catch { } } } } } IsLogged = LoginState == LoginState.LogOn; IsRecording = RecordState == RecordState.Recoding; if (IsRecording) { try { StrRecordLength = Converter.Second2Time(RecordLength); }catch {} } else { StrRecordLength = string.Empty; } try { StrVoiceFormat = ((EVLVoiceFormat)VoiceFormat).ToString(); }catch {} }
public RecordInfoItem(RecordInfo recordInfo) : this() { RowID = recordInfo.RowID; SerialID = recordInfo.SerialID; RecordReference = recordInfo.RecordReference; StartRecordTime = recordInfo.StartRecordTime; VoiceID = recordInfo.VoiceID; ChannelID = recordInfo.ChannelID; VoiceIP = recordInfo.VoiceIP; Extension = recordInfo.Extension; Agent = recordInfo.Agent; Duration = recordInfo.Duration; Direction = recordInfo.Direction; CallerID = recordInfo.CallerID; CalledID = recordInfo.CalledID; StopRecordTime = recordInfo.StopRecordTime; EncryptFlag = recordInfo.EncryptFlag; SkillGroup = recordInfo.SkillGroup; RealExtension = recordInfo.RealExtension; ParticipantNum = recordInfo.ParticipantNum; RecordInfo = recordInfo; LocalStartRecordTime = StartRecordTime.ToLocalTime(); LocalStopRecordTime = StopRecordTime.ToLocalTime(); ServiceAttitude = recordInfo.ServiceAttitude; RecordDurationExcept = recordInfo.RecordDuritionExcept; Score = recordInfo.Score; IsScored = recordInfo.IsScored; MediaType = recordInfo.MediaType; CallerDTMF = recordInfo.CallerDTMF; CalledDTMF = recordInfo.CalledDTMF; CTIReference = recordInfo.CTIReference; RepeatedCall = recordInfo.RepeatedCall; CallPeak = recordInfo.CallPeak; ProfessionalLevel = recordInfo.ProfessionalLevel; ExceptionScore = recordInfo.ExceptionScore; AfterDealDurationExcept = recordInfo.AfterDealDurationExcept; ACSpeExceptProportion = recordInfo.ACSpeExceptProportion; IsHaveBookMark = recordInfo.IsHaveBookMark; IsHaveMemo = recordInfo.IsHaveMemo; ChannelName = recordInfo.ChannelName; IsHaveVoiceBookMark = recordInfo.IsHaveVoiceBookMark; #region 客户化字段 CustomField01 = recordInfo.CustomField01; CustomField02 = recordInfo.CustomField02; CustomField03 = recordInfo.CustomField03; CustomField04 = recordInfo.CustomField04; CustomField05 = recordInfo.CustomField05; CustomField06 = recordInfo.CustomField06; CustomField07 = recordInfo.CustomField07; CustomField08 = recordInfo.CustomField08; CustomField09 = recordInfo.CustomField09; CustomField10 = recordInfo.CustomField10; CustomField11 = recordInfo.CustomField11; CustomField12 = recordInfo.CustomField12; CustomField13 = recordInfo.CustomField13; CustomField14 = recordInfo.CustomField14; CustomField15 = recordInfo.CustomField15; CustomField16 = recordInfo.CustomField16; CustomField17 = recordInfo.CustomField17; CustomField18 = recordInfo.CustomField18; CustomField19 = recordInfo.CustomField19; CustomField20 = recordInfo.CustomField20; #endregion }