Пример #1
0
        /// <summary>
        /// 查询呼叫前传信息
        /// </summary>
        public void GetFWDInfo()
        {
            try
            {
                if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null)
                {
                    return;
                }

                int          type = (int)ForwardServiceType.FORWARD_UNCONDITION;
                STCallExData data = new STCallExData();

                call.GetCallExService(type, ref data);

                if ((ForwardServiceType)type == ForwardServiceType.FORWARD_UNCONDITION && !string.IsNullOrEmpty(data.Num))
                {
                    isSetFWDUnCond  = true;
                    isSetFWDUnCond1 = true;
                }
                else
                {
                    isSetFWDUnCond  = false;
                    isSetFWDUnCond1 = false;
                }
                string str = System.Windows.Forms.Application.StartupPath;
                if (!isSetFWDUnCond)
                {
                    btnFWD.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\MobilePhone_2.png");
                }
                else
                {
                    btnFWD.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\MobilePhone_1.png");
                }
            }
            catch (System.Exception ex)
            {
                LogManager.SystemLog.Error(ex.ToString());
            }
        }
        public void StartLoadData()
        {
            try
               {
               UCUserInfo user = new UCUserInfo();
               user = XmlHelper.GetUserConfig();

               winOptionSetting.txtAccount.Text = user.UserID;
               winOptionSetting.comLang.SelectedIndex = Convert.ToInt32(user.Lang);

               winOptionSetting.txtPassword.Password = user.Password;
               winOptionSetting.txtPort.Text = user.Port;
               winOptionSetting.txtServer1.Text = user.Server;

               winOptionSetting.chkStart.IsChecked = user.AutoStart == "1" ? true : false;

               winOptionSetting.chkAvailable.IsChecked = user.Available;
               winOptionSetting.chkUnavailable.IsChecked = user.Unavailable;
               winOptionSetting.chkBusy.IsChecked = user.Busy;
               winOptionSetting.chkVoicemail.IsChecked = user.Voicemail;
               winOptionSetting.txtAvailable.Text = user.AvailableCallNumber;
               winOptionSetting.txtUnavailable.Text = user.UnavailableCallNumber;
               winOptionSetting.txtBusy.Text = user.BusyCallNumber;
               winOptionSetting.txtVoicemail.Text = user.VoicemailCallNumber;

               //设置呼叫前转信息
               if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null)
               {
                   return;
               }
               winOptionSetting.comMicrophone.SelectedIndex = GetMicrophone();
               winOptionSetting.comSpeaker.SelectedIndex = GetSpeaker();
               winOptionSetting.comCamera.SelectedIndex = GetCamera();

               int iRet = (int)UCServiceRetvCode.UC_SDK_Success;

               ForwardServiceType type = ForwardServiceType.FORWARD_UNCONDITION;
               STCallExData data = new STCallExData();
               MakeCallBusiness call = new MakeCallBusiness();

               //无条件前传
               iRet  = call.GetCallExService((int)type, ref data);
               if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
               {
                   LogManager.SystemLog.Error("GetCallExService error");
                   return;
               }
               winOptionSetting.radCallForwardUnCondEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
               winOptionSetting.txtCallForwardUnCond.Text = data.Num;

               //遇忙前传
               type = ForwardServiceType.FORWARD_ONBUSY;
               data = new STCallExData();

               iRet = call.GetCallExService((int)type, ref data);
               if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
               {
                   LogManager.SystemLog.Error("GetCallExService error");
                   return;
               }
               winOptionSetting.radCallForwardBusyEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
               winOptionSetting.txtCallForwardBusy.Text = data.Num;

               //无应答前传
               type = ForwardServiceType.FORWARD_NOREPLY;
               data = new STCallExData();

               iRet = call.GetCallExService((int)type, ref data);
               if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
               {
                   LogManager.SystemLog.Error("GetCallExService error");
                   return;
               }
               winOptionSetting.radCallForwardNoReplyEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
               winOptionSetting.txtCallForwardNoReply.Text = data.Num;

               //离线前传
               type = ForwardServiceType.FORWARD_OFFLINE;
               data = new STCallExData();

               iRet = call.GetCallExService((int)type, ref data);
               if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
               {
                   LogManager.SystemLog.Error("GetCallExService error");
                   return;
               }
               winOptionSetting.radCallForwardOfflineEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
               winOptionSetting.txtCallForwardOffline.Text = data.Num;

               //modify by 00327190   2015/7/30
               type = ForwardServiceType.VOICEMAIL_UNCONDITION;  //无条件语音邮箱前转
               data = new STCallExData();
               iRet = call.GetCallExService((int)type, ref data);
               if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
               {
                   LogManager.SystemLog.Error("GetCallExService error");
                   return;
               }
               winOptionSetting.radVoiceForwardUnCondEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
               //winOptionSetting.txtVoiceForwardUnCond.Text = data.Num;   //2015/8/24

               // 无应答语音邮箱前转
               type = ForwardServiceType.VOICEMAIL_NOREPLY;
               data = new STCallExData();
               iRet = call.GetCallExService((int)type, ref data);
               if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
               {
                   LogManager.SystemLog.Error("GetCallExService error");
                   return;
               }
               winOptionSetting.radVoiceForwardNoReplyEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
               //winOptionSetting.txtVoiceForwardNoReply.Text = data.Num;   //2015/8/24

               // 遇忙语音邮箱前转
               type = ForwardServiceType.VOICEMAIL_ONBUSY;
               data = new STCallExData();
               iRet = call.GetCallExService((int)type, ref data);
               if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
               {
                   LogManager.SystemLog.Error("GetCallExService error");
                   return;
               }
               winOptionSetting.radVoiceForwardBusyEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
               //winOptionSetting.txtVoiceForwardBusy.Text = data.Num;   //2015/8/24

               // 离线语音邮箱前转
               type = ForwardServiceType.VOICEMAIL_OFFLINE;
               data = new STCallExData();
               iRet = call.GetCallExService((int)type, ref data);
               if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
               {
                   LogManager.SystemLog.Error("GetCallExService error");
                   return;
               }
               winOptionSetting.radVoiceForwardOfflineEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
               //winOptionSetting.txtVoiceForwardOffline.Text = data.Num;   //2015/8/24

               }
               catch (System.Exception ex)
               {
               LogManager.SystemLog.Error(ex.ToString());
               }
        }
Пример #3
0
        public void StartLoadData()
        {
            try
            {
                UCUserInfo user = new UCUserInfo();
                user = XmlHelper.GetUserConfig();

                winOptionSetting.txtAccount.Text       = user.UserID;
                winOptionSetting.comLang.SelectedIndex = Convert.ToInt32(user.Lang);

                winOptionSetting.txtPassword.Password = user.Password;
                winOptionSetting.txtPort.Text         = user.Port;
                winOptionSetting.txtServer1.Text      = user.Server;

                winOptionSetting.chkStart.IsChecked = user.AutoStart == "1" ? true : false;


                winOptionSetting.chkAvailable.IsChecked   = user.Available;
                winOptionSetting.chkUnavailable.IsChecked = user.Unavailable;
                winOptionSetting.chkBusy.IsChecked        = user.Busy;
                winOptionSetting.chkVoicemail.IsChecked   = user.Voicemail;
                winOptionSetting.txtAvailable.Text        = user.AvailableCallNumber;
                winOptionSetting.txtUnavailable.Text      = user.UnavailableCallNumber;
                winOptionSetting.txtBusy.Text             = user.BusyCallNumber;
                winOptionSetting.txtVoicemail.Text        = user.VoicemailCallNumber;

                //设置呼叫前转信息
                if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null)
                {
                    return;
                }
                winOptionSetting.comMicrophone.SelectedIndex = GetMicrophone();
                winOptionSetting.comSpeaker.SelectedIndex    = GetSpeaker();
                winOptionSetting.comCamera.SelectedIndex     = GetCamera();

                int iRet = (int)UCServiceRetvCode.UC_SDK_Success;

                ForwardServiceType type = ForwardServiceType.FORWARD_UNCONDITION;
                STCallExData       data = new STCallExData();
                MakeCallBusiness   call = new MakeCallBusiness();

                //无条件前传
                iRet = call.GetCallExService((int)type, ref data);
                if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                {
                    LogManager.SystemLog.Error("GetCallExService error");
                    return;
                }
                winOptionSetting.radCallForwardUnCondEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
                winOptionSetting.txtCallForwardUnCond.Text        = data.Num;

                //遇忙前传
                type = ForwardServiceType.FORWARD_ONBUSY;
                data = new STCallExData();

                iRet = call.GetCallExService((int)type, ref data);
                if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                {
                    LogManager.SystemLog.Error("GetCallExService error");
                    return;
                }
                winOptionSetting.radCallForwardBusyEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
                winOptionSetting.txtCallForwardBusy.Text        = data.Num;

                //无应答前传
                type = ForwardServiceType.FORWARD_NOREPLY;
                data = new STCallExData();

                iRet = call.GetCallExService((int)type, ref data);
                if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                {
                    LogManager.SystemLog.Error("GetCallExService error");
                    return;
                }
                winOptionSetting.radCallForwardNoReplyEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
                winOptionSetting.txtCallForwardNoReply.Text        = data.Num;

                //离线前传
                type = ForwardServiceType.FORWARD_OFFLINE;
                data = new STCallExData();

                iRet = call.GetCallExService((int)type, ref data);
                if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                {
                    LogManager.SystemLog.Error("GetCallExService error");
                    return;
                }
                winOptionSetting.radCallForwardOfflineEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
                winOptionSetting.txtCallForwardOffline.Text        = data.Num;

                //modify by 00327190   2015/7/30
                type = ForwardServiceType.VOICEMAIL_UNCONDITION; //无条件语音邮箱前转
                data = new STCallExData();
                iRet = call.GetCallExService((int)type, ref data);
                if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                {
                    LogManager.SystemLog.Error("GetCallExService error");
                    return;
                }
                winOptionSetting.radVoiceForwardUnCondEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
                //winOptionSetting.txtVoiceForwardUnCond.Text = data.Num;   //2015/8/24

                // 无应答语音邮箱前转
                type = ForwardServiceType.VOICEMAIL_NOREPLY;
                data = new STCallExData();
                iRet = call.GetCallExService((int)type, ref data);
                if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                {
                    LogManager.SystemLog.Error("GetCallExService error");
                    return;
                }
                winOptionSetting.radVoiceForwardNoReplyEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
                //winOptionSetting.txtVoiceForwardNoReply.Text = data.Num;   //2015/8/24

                // 遇忙语音邮箱前转
                type = ForwardServiceType.VOICEMAIL_ONBUSY;
                data = new STCallExData();
                iRet = call.GetCallExService((int)type, ref data);
                if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                {
                    LogManager.SystemLog.Error("GetCallExService error");
                    return;
                }
                winOptionSetting.radVoiceForwardBusyEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
                //winOptionSetting.txtVoiceForwardBusy.Text = data.Num;   //2015/8/24

                // 离线语音邮箱前转
                type = ForwardServiceType.VOICEMAIL_OFFLINE;
                data = new STCallExData();
                iRet = call.GetCallExService((int)type, ref data);
                if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                {
                    LogManager.SystemLog.Error("GetCallExService error");
                    return;
                }
                winOptionSetting.radVoiceForwardOfflineEn.IsChecked = (string.IsNullOrEmpty(data.Num) ? false : true);
                //winOptionSetting.txtVoiceForwardOffline.Text = data.Num;   //2015/8/24
            }
            catch (System.Exception ex)
            {
                LogManager.SystemLog.Error(ex.ToString());
            }
        }