コード例 #1
0
        private bool TestPhone()
        {
            string telNum = this.txtTelNum.Text.Trim();

            if (string.IsNullOrEmpty(telNum))
            {
                MessageBox.Show("外呼号码不能为空!");
                txtTelNum.Focus();
                return(false);
            }
            if (!IsNumber(telNum))
            {
                MessageBox.Show("电话号码只能是数字");
                txtTelNum.Focus();
                return(false);
            }

            if (rgtest_fenji.Checked)
            {
                ConDeviceType = HollyContactHelper.ConDeviceType.分机号;
                ReturnNum     = telNum;
            }
            else if (rgtest_waixian.Checked)
            {
                ConDeviceType = HollyContactHelper.ConDeviceType.外线号码;
                ReturnNum     = rgtest_waixian.Tag.ToString() + telNum;
            }
            return(true);
        }
コード例 #2
0
        private bool Phone()
        {
            string telNum = this.txtTelNum.Text.Trim();

            if (string.IsNullOrEmpty(telNum))
            {
                MessageBox.Show("外呼号码不能为空!");
                txtTelNum.Focus();
                return(false);
            }
            if (!IsNumber(telNum))
            {
                MessageBox.Show("电话号码只能是数字");
                txtTelNum.Focus();
                return(false);
            }
            if (CallRecordHelper.Instance.CheckPhoneAndTelIsInBlackList(telNum))
            {
                MessageBox.Show("该号码已加入免打扰,禁止进行外呼!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtTelNum.Focus();
                return(false);
            }
            if (!(rdoNum1.Checked || rdoNum2.Checked || rdoNum3.Checked || rdoNum4.Checked || rdoNum5.Checked))
            {
                MessageBox.Show("请选择一条热线进行外呼!");
                txtTelNum.Focus();
                return(false);
            }

            string outNumber = ""; string errorMsg = "";

            if (LoginUser.LoginAreaType == AreaType.西安)
            {
                //本地区域属于西安
                VerifyPhoneFormatHelper.Instance.VerifyFormatXiAn(telNum, out outNumber, out errorMsg);
            }
            else if (LoginUser.LoginAreaType == AreaType.北京)
            {
                //本地区域属于北京
                VerifyPhoneFormatHelper.Instance.VerifyFormat(telNum, out outNumber, out errorMsg);
            }

            if (!string.IsNullOrEmpty(errorMsg))
            {
                MessageBox.Show(errorMsg);
                txtTelNum.Focus();
                return(false);
            }

            string tag = "";

            if (rdoNum1.Checked)
            {
                tag = rdoNum1.Tag.ToString();
            }
            else if (rdoNum2.Checked)
            {
                tag = rdoNum2.Tag.ToString();
            }
            else if (rdoNum3.Checked)
            {
                tag = rdoNum3.Tag.ToString();
            }
            else if (rdoNum4.Checked)
            {
                tag = rdoNum4.Tag.ToString();
            }
            else if (rdoNum5.Checked)
            {
                tag = rdoNum5.Tag.ToString();
            }

            ReturnNum     = tag + outNumber;
            ConDeviceType = HollyContactHelper.ConDeviceType.外线号码;
            return(true);
        }