コード例 #1
0
        public int GetCallExService(int _type, ref STCallExData _CallExData)
        {
            LogManager.SystemLog.Debug(string.Format("Start UC_SDK_GetCallExService"));
            int iRet = UCInterface.UC_SDK_GetCallExService(_type, ref _CallExData);

            if (iRet != 0)
            {
                LogManager.SystemLog.Error(string.Format("UC_SDK_GetCallExService = {0}", iRet));
            }
            LogManager.SystemLog.Debug(string.Format("End UC_SDK_GetCallExService"));
            return(iRet);
        }
コード例 #2
0
        public int SetCallExService(int iMemberType, STCallExData pMember)
        {
            LogManager.SystemLog.Debug(string.Format("Start UC_SDK_SetCallExService"));
            int iRet = UCInterface.UC_SDK_SetCallExService(iMemberType, ref pMember);

            if (iRet != 0)
            {
                LogManager.SystemLog.Error(string.Format("UC_SDK_SetCallExService = {0}", iRet));
            }
            LogManager.SystemLog.Debug(string.Format("End UC_SDK_SetCallExService"));
            return(iRet);
        }
コード例 #3
0
        /// <summary>
        /// 查询语音邮箱前传信息
        /// </summary>
        public void GetMailFrwInfo()
        {
            try
            {
                if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null)
                {
                    return;
                }

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

                call.GetCallExService(type, ref data);

                if ((ForwardServiceType)type == ForwardServiceType.VOICEMAIL_UNCONDITION && !string.IsNullOrEmpty(data.Num))
                {
                    isSetVoiceMailUnCond  = true;
                    isSetVoiceMailUnCond1 = true;
                }
                else
                {
                    isSetVoiceMailUnCond  = false;
                    isSetVoiceMailUnCond1 = false;
                }
                string str = System.Windows.Forms.Application.StartupPath;
                if (!isSetVoiceMailUnCond)
                {
                    btnMail.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\sms_2.png");
                }
                else
                {
                    btnMail.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\sms_1.png");
                }
            }
            catch (System.Exception ex)
            {
                LogManager.SystemLog.Error(ex.ToString());
            }
        }
コード例 #4
0
 public extern static int UC_SDK_GetCallExService(int _type, ref STCallExData _CallExData);//获取前传业务及号码
コード例 #5
0
 public extern static int UC_SDK_SetCallExService(int _type, ref STCallExData _Num);//设置呼叫前转
コード例 #6
0
        /// <summary>
        /// 设置呼叫前传
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void BtnFWD_Click(object sender, EventArgs e)
        {
            try
            {
                //通话时不能更改话机联动状态
                //You can't change joint type in a call
                if (Lync.winCall != null)
                {
                    DialogShow.Show(StringHelper.FindLanguageResource("CannotchangeFWDincall"), StringHelper.FindLanguageResource("error"), 2);
                    return;
                }
                else
                {
                    GetFWDInfo();
                    UserConfigBusiness conf = new UserConfigBusiness();
                    STContact          con  = new STContact();
                    int iRet = conf.GetContactInfo(new StringBuilder(SingletonObj.LoginInfo.UserID), ref con);
                    if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                    {
                        LogManager.SystemLog.Error("GetContactInfo error");
                        return;
                    }

                    STCallExData data = new STCallExData();

                    if (!isSetFWDUnCond)
                    {
                        if (string.IsNullOrEmpty(con.mobile_))
                        {
                            LogManager.SystemLog.Warn("user mobile is null");
                            Dialog.Show(StringHelper.FindLanguageResource("NoMoblePhone"), StringHelper.FindLanguageResource("error"));
                            return;
                        }
                        data.Num = con.mobile_;
                        LogManager.SystemLog.Info(string.Format("user mobile is {0}", data.Num));
                        iRet = call.SetCallExService((int)ForwardServiceType.FORWARD_UNCONDITION, data);

                        if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                        {
                            LogManager.SystemLog.Error("SetCallExService error");
                            return;
                        }

                        //查询设置结果
                        GetFWDInfo();

                        if (isSetFWDUnCond)
                        {
                            Dialog.Show(StringHelper.FindLanguageResource("FWDSuccess"), StringHelper.FindLanguageResource("Success"));
                        }
                        else
                        {
                            Dialog.Show(StringHelper.FindLanguageResource("FWDFailed"), StringHelper.FindLanguageResource("error"));
                        }
                    }
                    else
                    {
                        iRet = call.SetCallExService((int)ForwardServiceType.FORWARD_UNCONDITION, data);

                        if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                        {
                            LogManager.SystemLog.Error("SetCallExService error");
                            return;
                        }

                        //查询设置结果
                        GetFWDInfo();

                        if (!isSetFWDUnCond)
                        {
                            Dialog.Show(StringHelper.FindLanguageResource("CancelFWDSuccess"), StringHelper.FindLanguageResource("Success"));
                        }
                        else
                        {
                            Dialog.Show(StringHelper.FindLanguageResource("CancelFWDFailed"), StringHelper.FindLanguageResource("error"));
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                LogManager.SystemLog.Error(ex.ToString());
            }
        }
コード例 #7
0
        /// <summary>
        /// 语音邮箱呼叫前传
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void BtnMail_Click(object sender, EventArgs e)
        {
            //语音邮箱
            //通话时不能更改话机联动状态
            //You can't change joint type in a call
            if (Lync.winCall != null)
            {
                DialogShow.Show(StringHelper.FindLanguageResource("Cannotchangemailincall"), StringHelper.FindLanguageResource("error"), 2);
                return;
            }
            else
            {
                GetMailFrwInfo();  //7/30  先查询语音邮箱配置
                UserConfigBusiness conf = new UserConfigBusiness();
                STContact          con  = new STContact();
                int iRet = conf.GetContactInfo(new StringBuilder(SingletonObj.LoginInfo.UserID), ref con);
                if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                {
                    LogManager.SystemLog.Error("GetContactInfo error");
                    return;
                }
                //7/30
                STCallExData data = new STCallExData();
                //int iRet = 0;
                if (!isSetVoiceMailUnCond)
                {
                    //if (string.IsNullOrEmpty(con.email_))
                    //{
                    //    LogManager.SystemLog.Warn("email_ is null");
                    //    Dialog.Show(StringHelper.FindLanguageResource("NoVoicemail"), StringHelper.FindLanguageResource("error"));
                    //    return;
                    //}
                    //data.Num = con.email_;   //2015/8/13
                    data.Num = "1";
                    LogManager.SystemLog.Info(string.Format("email_ is {0}", data.Num));

                    iRet = call.SetCallExService((int)ForwardServiceType.VOICEMAIL_UNCONDITION, data);

                    if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                    {
                        LogManager.SystemLog.Error("SetCallExService error");
                        isSetVoiceMailUnCond = false;
                        Dialog.Show(StringHelper.FindLanguageResource("FWDMailFail"), StringHelper.FindLanguageResource("error"));
                        return;
                    }
                    else
                    {
                        GetMailFrwInfo();
                        if (isSetVoiceMailUnCond == true)
                        {
                            Dialog.Show(StringHelper.FindLanguageResource("FWDMailSuccess"), StringHelper.FindLanguageResource("Success"));
                        }
                        else
                        {
                            Dialog.Show(StringHelper.FindLanguageResource("FWDMailFail"), StringHelper.FindLanguageResource("error"));
                        }
                    }
                }
                else
                {
                    iRet = call.SetCallExService((int)ForwardServiceType.VOICEMAIL_UNCONDITION, data);

                    if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                    {
                        LogManager.SystemLog.Error("SetCallExService error");
                        isSetVoiceMailUnCond = true;
                        Dialog.Show(StringHelper.FindLanguageResource("CancelFWDMailFail"), StringHelper.FindLanguageResource("error"));
                        return;
                    }
                    else
                    {
                        GetMailFrwInfo();
                        if (!isSetVoiceMailUnCond)
                        {
                            Dialog.Show(StringHelper.FindLanguageResource("CancelFWDMailSuccess"), StringHelper.FindLanguageResource("Success"));
                        }
                        else
                        {
                            Dialog.Show(StringHelper.FindLanguageResource("CancelFWDMailFail"), StringHelper.FindLanguageResource("error"));
                        }
                    }
                }
            }
        }
コード例 #8
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());
            }
        }
コード例 #9
0
        //语音信箱转移
        private void MailForward_Click(object sender, RoutedEventArgs e)
        {
            if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null)
            {
                Dialog.Show(StringHelper.FindLanguageResource("NoUCAccount"), StringHelper.FindLanguageResource("SettingUC"));
                return;
            }
            try
            {
                MakeCallBusiness call = new MakeCallBusiness();
                STCallExData     data = new STCallExData();
                int iRet = 0;

                string buttonName = (sender as System.Windows.Controls.Button).Name;

                if (buttonName == "btnVoiceForwardUnCond")
                {
                    //无条件转语音邮箱
                    if ((bool)this.radVoiceForwardUnCondEn.IsChecked)
                    {
                        //data.Num = this.txtVoiceForwardUnCond.Text.Trim();
                        data.Num = "1";
                        if (string.IsNullOrEmpty(data.Num))
                        {
                            Dialog.Show(StringHelper.FindLanguageResource("MailNumberNullError"), StringHelper.FindLanguageResource("error"));
                            string str = System.Windows.Forms.Application.StartupPath;
                            lync.toolBar.BtnMail.Image = System.Drawing.Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\sms_2.png");
                            return;
                        }
                        else
                        {
                            iRet += call.SetCallExService((int)ForwardServiceType.VOICEMAIL_UNCONDITION, data);
                            if (iRet == 0)
                            {
                                string str = System.Windows.Forms.Application.StartupPath;
                                lync.toolBar.BtnMail.Image = System.Drawing.Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\sms_3.png");
                                //2015/8/11  一旦设置了无条件前转,则其他前转全部设置为关闭
                                data.Num = string.Empty;
                                call.SetCallExService((int)ForwardServiceType.VOICEMAIL_NOREPLY, data);
                                call.SetCallExService((int)ForwardServiceType.VOICEMAIL_OFFLINE, data);
                                call.SetCallExService((int)ForwardServiceType.VOICEMAIL_ONBUSY, data);
                            }
                        }
                    }
                    else
                    {
                        data.Num = string.Empty;
                        iRet    += call.SetCallExService((int)ForwardServiceType.VOICEMAIL_UNCONDITION, data);
                        if (iRet == 0)
                        {
                            string str = System.Windows.Forms.Application.StartupPath;
                            lync.toolBar.BtnMail.Image = System.Drawing.Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\sms_2.png");
                        }
                    }
                }
                else if (buttonName == "btnVoiceForwardNoReply")
                {
                    //无应答转语音邮箱
                    this.lync.toolBar.GetMailFrwInfo();
                    if (lync.toolBar.isSetVoiceMailUnCond1 == true)  //如果设置了无条件前转,则不能设置其他前转
                    {
                        Dialog.Show(StringHelper.FindLanguageResource("Cannottransfer"), StringHelper.FindLanguageResource("error"));
                        return;
                    }
                    else
                    {
                        if ((bool)this.radVoiceForwardNoReplyEn.IsChecked)
                        {
                            //data.Num = this.txtVoiceForwardNoReply.Text.Trim();
                            data.Num = "1";
                            if (string.IsNullOrEmpty(data.Num))
                            {
                                Dialog.Show(StringHelper.FindLanguageResource("MailNumberNullError"), StringHelper.FindLanguageResource("error"));
                                return;
                            }
                            else
                            {
                                iRet += call.SetCallExService((int)ForwardServiceType.VOICEMAIL_NOREPLY, data);
                            }
                        }
                        else
                        {
                            data.Num = string.Empty;
                            iRet    += call.SetCallExService((int)ForwardServiceType.VOICEMAIL_NOREPLY, data);
                        }
                    }
                }
                else if (buttonName == "btnVoiceForwardBusy")
                {
                    //遇忙转语音邮箱
                    this.lync.toolBar.GetMailFrwInfo();
                    if (lync.toolBar.isSetVoiceMailUnCond1 == true)  //如果设置了无条件前转,则不能设置其他前转
                    {
                        Dialog.Show(StringHelper.FindLanguageResource("Cannottransfer"), StringHelper.FindLanguageResource("error"));
                        return;
                    }
                    else
                    {
                        if ((bool)this.radVoiceForwardBusyEn.IsChecked)
                        {
                            //data.Num = this.txtVoiceForwardBusy.Text.Trim();
                            data.Num = "1";
                            if (string.IsNullOrEmpty(data.Num))
                            {
                                Dialog.Show(StringHelper.FindLanguageResource("MailNumberNullError"), StringHelper.FindLanguageResource("error"));
                                return;
                            }
                            else
                            {
                                iRet += call.SetCallExService((int)ForwardServiceType.VOICEMAIL_ONBUSY, data);
                            }
                        }
                        else
                        {
                            data.Num = string.Empty;
                            iRet    += call.SetCallExService((int)ForwardServiceType.VOICEMAIL_ONBUSY, data);
                        }
                    }
                }
                else if (buttonName == "btnVoiceForwardOffline")
                {
                    //离线转语音邮箱
                    this.lync.toolBar.GetMailFrwInfo();
                    if (lync.toolBar.isSetVoiceMailUnCond1 == true)  //如果设置了无条件前转,则不能设置其他前转
                    {
                        Dialog.Show(StringHelper.FindLanguageResource("Cannottransfer"), StringHelper.FindLanguageResource("error"));
                        return;
                    }
                    else
                    {
                        if ((bool)this.radVoiceForwardOfflineEn.IsChecked)
                        {
                            //data.Num = this.txtVoiceForwardOffline.Text.Trim();
                            data.Num = "1";
                            if (string.IsNullOrEmpty(data.Num))
                            {
                                Dialog.Show(StringHelper.FindLanguageResource("MailNumberNullError"), StringHelper.FindLanguageResource("error"));
                                return;
                            }
                            else
                            {
                                iRet += call.SetCallExService((int)ForwardServiceType.VOICEMAIL_OFFLINE, data);
                            }
                        }
                        else
                        {
                            data.Num = string.Empty;
                            iRet    += call.SetCallExService((int)ForwardServiceType.VOICEMAIL_OFFLINE, data);
                        }
                    }
                }
                else if (buttonName == "btnVoiceForwardDND")  //DND不做了  2015/8/11
                {
                    //离线呼叫前转
                    if ((bool)this.radVoiceForwardDNDEn.IsChecked)
                    {
                        //data.Num = this.txtVoiceForwardDND.Text.Trim();
                        data.Num = "1";
                        if (string.IsNullOrEmpty(data.Num))
                        {
                            Dialog.Show(StringHelper.FindLanguageResource("MailNumberNullError"), StringHelper.FindLanguageResource("error"));
                            return;
                        }
                        else
                        {
                            iRet += call.SetCallExService((int)ForwardServiceType.VOICEMAIL_UNCONDITION, data);
                        }
                    }
                    else
                    {
                        data.Num = string.Empty;
                        iRet    += call.SetCallExService((int)ForwardServiceType.VOICEMAIL_UNCONDITION, data);
                    }
                }

                if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                {
                    LogManager.SystemLog.Error("SetCallExService error");
                    //modify by jinyeqing
                    Dialog.Show(StringHelper.FindLanguageResource("FWDMailFail"), StringHelper.FindLanguageResource("error"));
                }
                else
                {
                    Dialog.Show(StringHelper.FindLanguageResource("FWDMailSuccess"), StringHelper.FindLanguageResource("Success"));
                }
            }
            catch (System.Exception ex)
            {
                LogManager.SystemLog.Error(ex.ToString());
            }
        }
コード例 #10
0
        private void CallForward_Click(object sender, RoutedEventArgs e)
        {
            if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null)
            {
                Dialog.Show(StringHelper.FindLanguageResource("NoUCAccount"), StringHelper.FindLanguageResource("SettingUC"));
                return;
            }
            try
            {
                MakeCallBusiness call = new MakeCallBusiness();
                STCallExData     data = new STCallExData();
                int iRet = 0;

                string buttonName = (sender as System.Windows.Controls.Button).Name;
                if (buttonName == "btnCallForwardUnCond")
                {
                    //无条件呼叫前传
                    if ((bool)this.radCallForwardUnCondEn.IsChecked)
                    {
                        data.Num = this.txtCallForwardUnCond.Text.Trim();
                        if (IsValidPhoneNumber(data.Num) == false)
                        {
                            DialogShow.Show(StringHelper.FindLanguageResource("Invalidnum"), StringHelper.FindLanguageResource("error"), 2);
                            return;
                        }
                        else if (string.IsNullOrEmpty(data.Num))
                        {
                            Dialog.Show(StringHelper.FindLanguageResource("PhoneNumberNullError"), StringHelper.FindLanguageResource("error"));
                            string str = System.Windows.Forms.Application.StartupPath;
                            lync.toolBar.BtnFWD.Image = System.Drawing.Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\MobilePhone_2.png");
                            return;
                        }
                        else
                        {
                            iRet += call.SetCallExService((int)ForwardServiceType.FORWARD_UNCONDITION, data);
                            if (iRet == 0)
                            {
                                string str = System.Windows.Forms.Application.StartupPath;
                                lync.toolBar.BtnFWD.Image = System.Drawing.Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\MobilePhone_3.png");
                                //2015/8/11  一旦设置了无条件前转,则其他前转全部设置为关闭
                                data.Num = string.Empty;
                                call.SetCallExService((int)ForwardServiceType.FORWARD_NOREPLY, data);
                                call.SetCallExService((int)ForwardServiceType.FORWARD_OFFLINE, data);
                                call.SetCallExService((int)ForwardServiceType.FORWARD_ONBUSY, data);
                            }
                        }
                    }
                    else
                    {
                        data.Num = string.Empty;
                        iRet    += call.SetCallExService((int)ForwardServiceType.FORWARD_UNCONDITION, data);
                        if (iRet == 0)
                        {
                            string str = System.Windows.Forms.Application.StartupPath;
                            lync.toolBar.BtnFWD.Image = System.Drawing.Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\MobilePhone_2.png");
                        }
                    }
                }
                else if (buttonName == "btnCallForwardNoReply")
                {
                    //不回复呼叫前转
                    this.lync.toolBar.GetFWDInfo();
                    if (lync.toolBar.isSetFWDUnCond1 == true)  //如果设置了无条件前转,则不能设置其他前转
                    {
                        Dialog.Show(StringHelper.FindLanguageResource("Cannottransfer"), StringHelper.FindLanguageResource("error"));
                        return;
                    }
                    else
                    {
                        if ((bool)this.radCallForwardNoReplyEn.IsChecked)
                        {
                            data.Num = this.txtCallForwardNoReply.Text.Trim();
                            if (IsValidPhoneNumber(data.Num) == false)
                            {
                                DialogShow.Show(StringHelper.FindLanguageResource("Invalidnum"), StringHelper.FindLanguageResource("error"), 2);
                                return;
                            }
                            else if (string.IsNullOrEmpty(data.Num))
                            {
                                Dialog.Show(StringHelper.FindLanguageResource("PhoneNumberNullError"), StringHelper.FindLanguageResource("error"));
                                return;
                            }
                            else
                            {
                                iRet += call.SetCallExService((int)ForwardServiceType.FORWARD_NOREPLY, data);
                            }
                        }
                        else
                        {
                            data.Num = string.Empty;
                            iRet    += call.SetCallExService((int)ForwardServiceType.FORWARD_NOREPLY, data);
                        }
                    }
                }
                else if (buttonName == "btnCallForwardBusy")
                {
                    //遇忙呼叫前转
                    this.lync.toolBar.GetFWDInfo();
                    if (lync.toolBar.isSetFWDUnCond1 == true)  //如果设置了无条件前转,则不能设置其他前转
                    {
                        Dialog.Show(StringHelper.FindLanguageResource("Cannottransfer"), StringHelper.FindLanguageResource("error"));
                        return;
                    }
                    else
                    {
                        if ((bool)this.radCallForwardBusyEn.IsChecked)
                        {
                            data.Num = this.txtCallForwardBusy.Text.Trim();
                            if (IsValidPhoneNumber(data.Num) == false)
                            {
                                DialogShow.Show(StringHelper.FindLanguageResource("Invalidnum"), StringHelper.FindLanguageResource("error"), 2);
                                return;
                            }
                            else if (string.IsNullOrEmpty(data.Num))
                            {
                                Dialog.Show(StringHelper.FindLanguageResource("PhoneNumberNullError"), StringHelper.FindLanguageResource("error"));
                                return;
                            }
                            else
                            {
                                iRet += call.SetCallExService((int)ForwardServiceType.FORWARD_ONBUSY, data);
                            }
                        }
                        else
                        {
                            data.Num = string.Empty;
                            iRet    += call.SetCallExService((int)ForwardServiceType.FORWARD_ONBUSY, data);
                        }
                    }
                }
                else if (buttonName == "btnCallForwardOffline")
                {
                    //离线呼叫前转
                    this.lync.toolBar.GetFWDInfo();
                    if (lync.toolBar.isSetFWDUnCond1 == true)  //如果设置了无条件前转,则不能设置其他前转
                    {
                        Dialog.Show(StringHelper.FindLanguageResource("Cannottransfer"), StringHelper.FindLanguageResource("error"));
                        return;
                    }
                    else
                    {
                        if ((bool)this.radCallForwardOfflineEn.IsChecked)
                        {
                            data.Num = this.txtCallForwardOffline.Text.Trim();
                            if (IsValidPhoneNumber(data.Num) == false)
                            {
                                DialogShow.Show(StringHelper.FindLanguageResource("Invalidnum"), StringHelper.FindLanguageResource("error"), 2);
                                return;
                            }
                            else if (string.IsNullOrEmpty(data.Num))
                            {
                                Dialog.Show(StringHelper.FindLanguageResource("PhoneNumberNullError"), StringHelper.FindLanguageResource("error"));
                                return;
                            }
                            else
                            {
                                iRet += call.SetCallExService((int)ForwardServiceType.FORWARD_OFFLINE, data);
                            }
                        }
                        else
                        {
                            data.Num = string.Empty;
                            iRet    += call.SetCallExService((int)ForwardServiceType.FORWARD_OFFLINE, data);
                        }
                    }
                }
                else if (buttonName == "btnCallForwardDND")   //DND取消了  2015/8/11
                {
                    //离线呼叫前转
                    if ((bool)this.radCallForwardDNDEn.IsChecked)
                    {
                        data.Num = this.txtCallForwardDND.Text.Trim();
                        if (IsValidPhoneNumber(data.Num) == false)
                        {
                            DialogShow.Show(StringHelper.FindLanguageResource("Invalidnum"), StringHelper.FindLanguageResource("error"), 2);
                            return;
                        }
                        else if (string.IsNullOrEmpty(data.Num))
                        {
                            Dialog.Show(StringHelper.FindLanguageResource("PhoneNumberNullError"), StringHelper.FindLanguageResource("error"));
                            return;
                        }
                        else
                        {
                            iRet += call.SetCallExService((int)ForwardServiceType.FORWARD_UNCONDITION, data);
                        }
                    }
                    else
                    {
                        data.Num = string.Empty;
                        iRet    += call.SetCallExService((int)ForwardServiceType.FORWARD_UNCONDITION, data);
                    }
                }

                if (iRet != (int)UCServiceRetvCode.UC_SDK_Success)
                {
                    LogManager.SystemLog.Error("SetCallExService error");
                    Dialog.Show(StringHelper.FindLanguageResource("FWDFailed"), StringHelper.FindLanguageResource("error"));
                }
                else
                {
                    Dialog.Show(StringHelper.FindLanguageResource("FWDSuccess"), StringHelper.FindLanguageResource("Success"));
                }
            }
            catch (System.Exception ex)
            {
                LogManager.SystemLog.Error(ex.ToString());
            }
        }