private void QryAndShowAgentSkillsInfo()
        {
            var iBuss = BusinessAdapter.GetBusinessInstance();

            if (null == iBuss)
            {
                return;
            }
            var lstSkills = iBuss.GetAgentSkills();

            if (null == lstSkills || lstSkills.Count == 0)
            {
                return;
            }
            var lstSignSkills  = ((AgentGatewayBusiness)BusinessAdapter.GetBusinessInstance()).GetAgentSignedSkills();
            var lstSignSkillId = lstSignSkills == null || lstSignSkills.Count == 0 ?
                                 new List <string>() : lstSignSkills.Select(item => item.id).ToList();

            lstView_Skills.ItemsSource = lstSkills.Select(item =>
                                                          new SkillItem()
            {
                isSelected = lstSignSkillId.Contains(item.id),
                id         = item.id,
                name       = item.name
            }).ToList();
        }
        private void OK_Click(object sender, RoutedEventArgs e)
        {
            int  num;
            bool parseSuccess = int.TryParse(txtTime.Text, out num);

            if (!parseSuccess)
            {
                ShowMessage.ShowMessageBox("contentUnLegal");
                return;
            }
            if (string.IsNullOrEmpty(txtTime.Text) || num < 1 || num > 59)
            {
                ShowMessage.ShowMessageBox("contentUnLegal");
                return;
            }
            string agentId = MainWindow.Instance().AgentInfo.AgentId;
            string result  = BusinessAdapter.GetBusinessInstance().RestEx(num * 60, 0);

            Log4NetHelper.ActionLog("Common", "Vc_Rest", result);

            if (result != null)
            {
                IsRestSuccess = result.Equals(AGWErrorCode.OK);
                if (!result.Equals(AGWErrorCode.OK))
                {
                    MessageBox.Show("Rest failed,Error Code ; " + result);
                }
                else
                {
                    MainWindow.Instance().RestTime = num.ToString();
                }
            }
            this.DialogResult = true;
        }
        private void Btn_OK_Click(object sender, RoutedEventArgs e)
        {
            if (lstView_Skills.ItemsSource == null)
            {
                return;
            }
            if (!SkillSelectCheck())
            {
                return;
            }

            var lstId = new List <int>();

            foreach (SkillItem item in lstView_Skills.Items)
            {
                if (!item.isSelected)
                {
                    continue;
                }
                int id = 0;
                if (Int32.TryParse(item.id, out id))
                {
                    lstId.Add(id);
                }
            }
            var res = ((AgentGatewayBusiness)(BusinessAdapter.GetBusinessInstance())).ResetSkillEx(false, lstId, chk_PhoneLink.IsChecked.Value);

            if (AGWErrorCode.OK.Equals(res))
            {
                MessageBox.Show(LanguageResource.FindResourceMessageByKey("otherset_resetskillsucc"));
            }
        }
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            if (dgrdHoldList.SelectedIndex < 0)
            {
                return;
            }
            string       logInfo     = string.Empty;
            string       result      = null;
            int          index       = dgrdHoldList.SelectedIndex;
            HoldCallInfo curHoldInfo = holdInfoList[index];

            switch (_myType)
            {
            case OperateType.Tripartite:
                result = BusinessAdapter.GetBusinessInstance().ConfJoinEx(curHoldInfo.callId);
                Log4NetHelper.ActionLog("Common", "Vc_ConfJoinEx", result);
                logInfo = "Tripartite Call Failure, ErrorCode : ";
                break;

            case OperateType.ConnectHold:
                result = BusinessAdapter.GetBusinessInstance().ConnectHoldEx(curHoldInfo.callId);
                Log4NetHelper.ActionLog("Common", "Vc_ConnectHold", result);
                logInfo = "Connect Hold Calling Failure, ErrorCode : ";
                break;

            default:
                break;
            }
            if (result != null && !result.Equals(AGWErrorCode.OK))
            {
                MessageBox.Show(logInfo + result);
            }
            this.DialogResult = true;
        }
Exemple #5
0
 /// <summary>
 /// window initial method extentds
 /// </summary>
 /// <param name="vrc">axVrcControl instance</param>
 /// <param name="agentId">agentID</param>
 /// <param name="info">Vrc server ip and port</param>
 /// <remarks>info format: ip(port)</remarks>
 public RecordWin(AxVRCCONTROLLib.AxVRCControl vrc, string agentId)
 {
     InitializeComponent();
     LanguageResource.ChangeWindowLanguage(this);
     this._agentID = agentId;
     this._vrc     = vrc;
     _agwBus       = BusinessAdapter.GetBusinessInstance() as AgentGatewayBusiness;
 }
        private void DataGridSelectionChanged(Object sender, EventArgs e)
        {
            var item = dgrdCallList.SelectedItem as CallInfo;

            if (null == item)
            {
                return;
            }
            txtBoxData.Text = BusinessAdapter.GetBusinessInstance().QryData(item.CallId);
        }
        /// <summary>
        /// qry button click
        /// </summary>
        /// <param name="sender">button</param>
        /// <param name="e">click event</param>
        private void btn_qry_Click(object sender, EventArgs e)
        {
            tb_msgshow.Text = string.Empty;
            if (string.IsNullOrEmpty(tb_pageNo.Text) || string.IsNullOrEmpty(tb_pageSize.Text))
            {
                return;
            }

            var instance = (AgentGatewayBusiness)BusinessAdapter.GetBusinessInstance();

            if (null == instance)
            {
                Log4NetHelper.BaseLog("Instance is null");
                return;
            }
            var qryParm = new CallSessionQryParm()
            {
                startTime    = TransferDateToTimeStamp(tb_startTime.Text),
                endTime      = TransferDateToTimeStamp(tb_endTime.Text),
                pageNo       = tb_pageNo.Text,
                pageSize     = tb_pageSize.Text,
                callType     = tb_callType.Text,
                caller       = tb_caller.Text,
                called       = tb_called.Text,
                mediaType    = "1",
                subMediaType = "2",
                realCaller   = "",
                callerName   = ""
            };
            var qryInfo = HuaweiAgentGateway.Utils.JsonUtil.ToJson(qryParm);

            try
            {
                var res = instance.QryCallSession(qryInfo);
                if (null == res)
                {
                    MessageBox.Show(LanguageResource.FindResourceMessageByKey("textchat_qryfailed"));
                    return;
                }
                Log4NetHelper.ActionLog("Agw", "QryCallSession", res.retcode);
                if (null == res.result)
                {
                    return;
                }
                lbl_totalPage.Content  = res.result.totalPageNo;
                lbl_totalCount.Content = res.result.totalCount;
                UIViewHelper.SelectorResetSource(dgrd_callsession, res.result.weccCallBillList);
            }
            catch (Exception exc)
            {
                Log4NetHelper.BaseLog(exc.Message);
            }
        }
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            if (-1 == dgrdCallList.SelectIndex)
            {
                MessageBox.Show(LanguageResource.FindResourceMessageByKey("setdata_selecttalk"));
                return;
            }
            var    data   = m_CallInfo[dgrdCallList.SelectIndex];
            string result = BusinessAdapter.GetBusinessInstance().GetHoldEx(data.CallId);

            Log4NetHelper.ActionLog("Common", "Vc_GetHold", result);

            if (!string.IsNullOrEmpty(result) && !AGWErrorCode.OK.Equals(result))
            {
                MainWindow.Instance().MessageBoxForErr(result);
            }
            Close();
        }
Exemple #9
0
        /// <summary>
        /// window initail method
        /// </summary>
        public TC_Sms()
        {
            InitializeComponent();
            LanguageResource.ChangeWindowLanguage(this);
            var business = BusinessAdapter.GetBusinessInstance() as AgentGatewayBusiness;

            if (null == business)
            {
                return;;
            }
            var lstSkills = business.GetAgentSkills();

            UIViewHelper.SelectorResetSource(cb_skills, lstSkills);
            if (null == lstSkills || 0 == lstSkills.Count)
            {
                return;
            }
            cb_skills.SelectedIndex = 0;
        }
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txtCallNumber.Text))
            {
                ShowMessage.ShowMessageBox("nullTransferObject");
                return;
            }

            AGWTransferData transferData = new AGWTransferData();

            transferData.devicetype = 5;//转给外部号码
            transferData.address    = txtCallNumber.Text;
            transferData.caller     = txtCallerNumber.Text;
            if (rbtnReleaseTransfer.IsChecked == true)
            {
                transferData.mode = 1;
            }
            else if (rbtnSuccessTransfer.IsChecked == true)
            {
                transferData.mode = 2;
            }
            else if (rbtnCallTransfer.IsChecked == true)
            {
                transferData.mode = 3;
            }
            else if (rbtnTripartiteTransfer.IsChecked == true)
            {
                transferData.mode = 4;
            }

            string result = BusinessAdapter.GetBusinessInstance().TransOutEx(OCX_MEDIA_TYPE, transferData.caller, transferData.address, transferData.mode, 0, "");

            Log4NetHelper.ActionLog("Common", "Vc_TransOut", result);
            if (result != null)
            {
                if (!result.Equals(AGWErrorCode.OK))
                {
                    MessageBox.Show("Transfer out failed.error code : " + result);
                }
            }

            this.DialogResult = true;
        }
Exemple #11
0
        private void btnReply_Click(object sender, EventArgs e)
        {
            if (dgrdMsgList.SelectedItem == null || dgrdMsgList.SelectedItems == null)
            {
                return;
            }
            var           item      = dgrdMsgList.SelectedItem as MessageInfo;
            SendMsgWindow msgWindow = new SendMsgWindow(item.WorkNo);

            msgWindow.ShowDialog();
            if (msgWindow.IsConfirm)
            {
                string res = BusinessAdapter.GetBusinessInstance().SendNote(Int32.Parse(msgWindow.WorkNo), msgWindow.TxtContent);
                Log4NetHelper.ActionLog("Common", "Vc_SendNote", res);
                if (!res.Equals(AGWErrorCode.OK))
                {
                    MessageBox.Show(LanguageResource.FindResourceMessageByKey("msgview_fail"));
                }
            }
        }
Exemple #12
0
        public TC_CallTrans()
        {
            InitializeComponent();
            LanguageResource.ChangeWindowLanguage(this);
            var lstSkillsSrc   = ((AgentGatewayBusiness)(BusinessAdapter.GetBusinessInstance())).QrySkillsOnAgentVDN();
            var lstItemsSkills = new List <AGWVdnSkills>();

            if (lstSkillsSrc != null && lstSkillsSrc.Count > 0)
            {
                foreach (var item in lstSkillsSrc)
                {
                    if (item.mediatype != 1)
                    {
                        continue;
                    }
                    lstItemsSkills.Add(item);
                }
                lst_skills.ItemsSource = lstItemsSkills;
            }
        }
        /// <summary>
        /// qry button click
        /// </summary>
        /// <param name="sender">button</param>
        /// <param name="e">click event</param>
        private void btn_qry_Click(object sender, EventArgs e)
        {
            tb_msgshow.Text = string.Empty;
            if (string.IsNullOrEmpty(tb_pageNo.Text) || string.IsNullOrEmpty(tb_pageSize.Text))
            {
                return;
            }

            try
            {
                if (BusinessAdapter.CurrentBusinessType == BusinessType.OCX)
                {
                    Log4NetHelper.BaseLog("Instance is ocx");
                    return;
                }
                if (null == BusinessAdapter.GetBusinessInstance())
                {
                    Log4NetHelper.BaseLog("Instance is null");
                    return;
                }

                var res = ((AgentGatewayBusiness)BusinessAdapter.GetBusinessInstance()).QryCallContent(tb_callID.Text, tb_pageSize.Text, tb_pageNo.Text);
                if (null == res)
                {
                    MessageBox.Show(LanguageResource.FindResourceMessageByKey("textchat_qryfailed"));
                    return;
                }
                Log4NetHelper.ActionLog("Agw", "QryCallContent", res.retcode);
                if (null == res.result)
                {
                    return;
                }
                lbl_totalPage.Content  = res.result.totalPageNo;
                lbl_totalCount.Content = res.result.totalCount;
                UIViewHelper.SelectorResetSource(dgrd_callcontent, res.result.weccCallContentList);
            }
            catch (Exception exc)
            {
                Log4NetHelper.BaseLog(exc.Message);
            }
        }
Exemple #14
0
        private void btnSet_Click(Object sender, EventArgs e)
        {
            if (m_CallInfo == null)
            {
                return;
            }
            if (dgrdCallList.SelectIndex == -1)
            {
                MessageBox.Show(LanguageResource.FindResourceMessageByKey("setdata_selecttalk"));
                return;
            }

            var item = m_CallInfo[dgrdCallList.SelectIndex];
            var res  = BusinessAdapter.GetBusinessInstance().SetData(item.CallId + "", txtBoxData.Text, 5);

            Log4NetHelper.ActionLog("Common", "Vc_SetData", res);
            if (res.Equals(AGWErrorCode.OK))
            {
                MessageBox.Show(LanguageResource.FindResourceMessageByKey("setDataSucc"));
            }
        }
        public IResponse <NoValue> CreateBusinessAdapter(BusinessAdapterModel businessAdapter, long userProfileId)
        {
            var response = new Response <NoValue>();

            try
            {
                //refactor with properties
                Adapter newAdapter = new Adapter
                {
                    Name              = businessAdapter.Name,
                    UserProfileId     = userProfileId,
                    AdapterTypeItemId = (int)businessAdapter.BusinessAdapterType,
                    StatusId          = (int)Statuses.Active,
                    DirectionId       = (int)businessAdapter.Direction
                };

                BusinessAdapter newBusinessAdapter = new BusinessAdapter
                {
                    AdapterId = newAdapter.Id,
                    Filename  = businessAdapter.FileName
                };

                _entity.Adapter.Add(newAdapter);
                _entity.BusinessAdapter.Add(newBusinessAdapter);

                _entity.SaveChanges();

                response.Message = "Business adapter added successfully.";
                response.Status  = StatusEnum.Success;
            }
            catch (Exception ex)
            {
                _logger.Information($"BusinessAdapterService.CreateBusinessAdapter(userProfileId: {userProfileId}");
                _logger.Error(ex.Message);
                response.Status  = StatusEnum.Error;
                response.Message = ex.Message;
            }

            return(response);
        }
        public CallOutWindow()
        {
            InitializeComponent();
            LanguageResource.ChangeWindowLanguage(this);
            this.Closed += new EventHandler(Window_Close);

            #region  控件设置(技能,媒体能力)

            ctrlHead.SetText(LanguageResource.FindResourceMessageByKey("outcall_head"));
            cbxMedia.ItemsSource = BusinessAdapter.CurrentBusinessType == BusinessType.OCX ?
                                   DIC_MCP_MEDIA.Values : DIC_AGW_MEDIA.Values;
            cbxMedia.SelectedIndex = BusinessAdapter.CurrentBusinessType == BusinessType.OCX ?
                                     2 : 0;

            _skillSrc = BusinessAdapter.GetBusinessInstance().GetAgentSkills();
            if (null == _skillSrc || _skillSrc.Count == 0)
            {
                return;
            }
            // 查询技能,增加一项 "默认"
            _skillSrc.Insert(0, new SkillInfo()
            {
                name = LanguageResource.FindResourceMessageByKey("outcall_default"), id = "0", mediatype = "5"
            });
            cbxSkill.ItemsSource   = _skillSrc.Select(item => item.name).ToList();
            cbxSkill.SelectedIndex = 0;

            #endregion

            #region  控件样式

            txtBlockSkill.Style   = (Style)this.FindResource("txtBlockStyle");
            lblCalledNumber.Style = (Style)this.FindResource("txtBlockStyle");
            lblCallerNumber.Style = (Style)this.FindResource("txtBlockStyle");
            txtBlockMedia.Style   = (Style)this.FindResource("txtBlockStyle");
            txtBlockCheck.Style   = (Style)this.FindResource("txtBlockStyle");

            #endregion
        }
Exemple #17
0
        public void OK_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                AgentStateInfo statusInfo = agentInfoCtrl.SelectedAgent;
                if (null == statusInfo)
                {
                    return;
                }
                if (string.Compare(MainWindow.Instance().AgentInfo.AgentId, statusInfo.workno, true) == 0)
                {
                    MessageBox.Show(LanguageResource.FindResourceMessageByKey("innercall_choseselef"));
                    return;
                }

                string result = BusinessAdapter.GetBusinessInstance().CallInnerEx(statusInfo.workno, OCX_MEDIA_TYPE);
                Log4NetHelper.ActionLog("Common", "Vc_CallInner", result);

                if (result != null)
                {
                    if (!result.Equals(AGWErrorCode.OK))
                    {
                        MessageBox.Show(LanguageResource.FindResourceMessageByKey("internalcall_fail"));
                    }
                    else
                    {
                        if (BusinessAdapter.CurrentBusinessType == BusinessType.AgentGateway)
                        {
                            MainWindow.Instance().TalkStatus = MainWindow.AgentStatus.InternaCall;
                        }
                    }
                }
                this.DialogResult = true;
            }
            catch (Exception exc)
            {
                Log4NetHelper.ExcepLog("Sys", "InnerCall", exc.Message);
            }
        }
Exemple #18
0
 public void DetachEvents()
 {
     BusinessAdapter.GetBusinessInstance().DetachEvents(this);
 }
Exemple #19
0
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            AGWInnerHelp innerHelpData = new AGWInnerHelp();

            switch (_consultType)
            {
            case ConsultType.Agent:
                if (string.IsNullOrEmpty(txtAgentId.Text))
                {
                    ShowMessage.ShowMessageBox("inputBusinessAgentId");
                    return;
                }
                innerHelpData.devicetype = 2;
                AgentStateInfoWrapper curSelectAgent = lstAgentStatusInfo.SelectedItem as AgentStateInfoWrapper;
                bool   isCall = false;
                string status = curSelectAgent.status;
                if (status.Equals("1") || status.Equals("4") || status.Equals("6"))
                {
                    isCall = true;
                }
                if (!isCall)
                {
                    ShowMessage.ShowMessageBox("isNotIdleAgent");
                    return;
                }
                innerHelpData.dstaddress = txtAgentId.Text;
                break;

            case ConsultType.Skill:
                if (lstSkillsQueue.SelectedIndex < 0)
                {
                    ShowMessage.ShowMessageBox("choiceSkillQueue");
                    return;
                }
                innerHelpData.devicetype = 1;
                innerHelpData.dstaddress = _skillSelectedId;

                break;

            default:
                break;
            }

            if (rbtnTwoPartiesConsult.IsChecked == true)
            {
                innerHelpData.mode = 1;
            }
            else if (rbtnTripartiteConsult.IsChecked == true)
            {
                innerHelpData.mode = 2;
            }

            string result = BusinessAdapter.GetBusinessInstance().InternalHelp(5, innerHelpData.dstaddress, innerHelpData.mode, innerHelpData.devicetype);

            Log4NetHelper.ActionLog("Common", "Vc_InnerHelp", result);

            if (null == result)
            {
                this.DialogResult = true;
                return;
            }
            if (!result.Equals(AGWErrorCode.OK))
            {
                MessageBox.Show(LanguageResource.FindResourceMessageByKey("internalhelp_fail"));
                if (BusinessAdapter.CurrentBusinessType == BusinessType.AgentGateway)
                {
                    MainWindowVM.GetInstance().AgentState = LanguageResource.FindResourceMessageByKey("internalhelp_fail");
                }
            }
            else
            {
                if (BusinessAdapter.CurrentBusinessType == BusinessType.AgentGateway)
                {
                    MainWindowVM.GetInstance().AgentState = LanguageResource.FindResourceMessageByKey("internalhelp_succ");
                    MainWindow.Instance().TalkStatus      = MainWindow.AgentStatus.InternaHelp;
                }
            }
            this.DialogResult = true;
        }
Exemple #20
0
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            AGWTransferData transferData = new AGWTransferData();

            switch (_transferType)
            {
            case TransferType.Agent:
                if (string.IsNullOrEmpty(txtAgentId.Text))
                {
                    ShowMessage.ShowMessageBox("nullTransferObject");
                    return;
                }
                transferData.devicetype = 2;
                transferData.address    = txtAgentId.Text;
                int selectIndex = cboTransferWay.SelectedIndex;
                if (selectIndex.Equals(0))
                {
                    transferData.mode = 0;
                }
                else if (selectIndex.Equals(1))
                {
                    transferData.mode = 2;
                }
                else if (selectIndex.Equals(2))
                {
                    transferData.mode = 3;
                }
                else if (selectIndex.Equals(3))
                {
                    transferData.mode = 4;
                }
                break;

            case TransferType.Ivr:
                if (string.IsNullOrEmpty(txtIVRAccessCode.Text))
                {
                    ShowMessage.ShowMessageBox("nullTransferObject");
                    return;
                }
                transferData.devicetype = 3;
                transferData.address    = txtIVRAccessCode.Text;
                if (rbtnHungUp_IVR.IsChecked == true)
                {
                    transferData.mode = 1;
                }
                else if (rbtnRelease_IVR.IsChecked == true)
                {
                    transferData.mode = 0;
                }
                break;

            case TransferType.Skill:
                if (string.IsNullOrEmpty(txtSkill.Text))
                {
                    ShowMessage.ShowMessageBox("nullTransferObject");
                    return;
                }
                transferData.devicetype = 1;
                string id = (lstSkillsQueue.SelectedItem as SkillInfo).id;
                transferData.address = id;
                if (rbtnSuccess_Skill.IsChecked == true)
                {
                    transferData.mode = 2;
                }
                else if (rbtnRelease_Skill.IsChecked == true)
                {
                    transferData.mode = 0;
                }
                break;

            case TransferType.AccessCode:
                if (string.IsNullOrEmpty(txtAccessCode.Text))
                {
                    ShowMessage.ShowMessageBox("nullTransferObject");
                    return;
                }
                transferData.devicetype = 4;
                transferData.address    = txtAccessCode.Text;
                if (rbtnSuccess_AccessCode.IsChecked == true)
                {
                    transferData.mode = 2;
                }
                else if (rbtnRelease_AccessCode.IsChecked == true)
                {
                    transferData.mode = 0;
                }
                break;

            default:
                break;
            }

            string result = BusinessAdapter.GetBusinessInstance().TransInnerEx(OCX_MEDIA_TYPE, transferData.mode, transferData.address, transferData.devicetype);

            Log4NetHelper.ActionLog("Common", "Vc_CallTrans", result);
            if (result != null)
            {
                if (!result.Equals(AGWErrorCode.OK))
                {
                    MainWindow.Instance().MessageBoxForErr(result);
                }
            }
            this.DialogResult = true;
        }