Ejemplo n.º 1
0
        public void UpdateInfo(ChanState info)
        {
            Extension       = info.Extension;
            AgentID         = info.AgentID;
            LoginState      = info.LoginState;
            CallState       = info.CallState;
            RecordState     = info.RecordState;
            RecordReference = info.RecordReference;
            DirectionFlag   = info.DirectionFlag;
            CallerID        = info.CallerID;
            CalledID        = info.CalledID;
            StartRecordTime = info.StartRecordTime;
            StopRecordTime  = info.StopRecordTime;
            RecordLength    = info.RecordLength;

            StrLoginState      = LoginState.ToString();
            StrCallState       = CallState.ToString();
            StrRecordState     = RecordState.ToString();
            StrDirection       = DirectionFlag.ToString();
            StrStartRecordTime = StartRecordTime.ToString("yyyy-MM-dd HH:mm:ss");
            StrStopRecordTime  = StopRecordTime.ToString("yyyy-MM-dd HH:mm:ss");
            StrRecordLength    = RecordLength.ToString();

            Info = info;
        }
Ejemplo n.º 2
0
 public override string ToString()
 {
     return(string.Format("{0},{1},{2},{3},{4}", RecordReference, StartRecordTime.ToString("yyyy-MM-dd HH:mm:ss"),
                          Channel, Extension, AgentID));
 }
Ejemplo n.º 3
0
        /// <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 {}
        }
Ejemplo n.º 4
0
        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
        }