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; }
private void Btn_Ok_Click(object sender, RoutedEventArgs e) { if (null == _voice || 0 == _videoList.Count || string.IsNullOrEmpty(tb_path.Text) || null == _videoList || -1 == Cb_Device.SelectedIndex) { return; } var item = _videoList[Cb_Device.SelectedIndex]; if (null == item) { return; } var info = JsonUtil.ToJson(new VoiceSnapShot() { deviceIndex = item.deviceIndex, height = DEAULT_SIZE, width = DEAULT_SIZE, filePath = tb_path.Text }); try { var res = _voice.SnapShot(info); Log4NetHelper.ActionLog("Voice", "SnapShot", res); } catch (COMException exc) { Log4NetHelper.BaseLog(exc.Message); } }
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; }
/// <summary> /// stop record screen click /// </summary> /// <param name="sender">button</param> /// <param name="e">click event</param> private void btn_stop_Click(object sender, EventArgs e) { if (null == _agwBus) { return; } var res = _agwBus.StopRecordScreen(); Log4NetHelper.ActionLog("Agw", "StopRecordScreen", res); }
/// <summary> /// start record screen click /// </summary> /// <param name="sender">button</param> /// <param name="e">click event</param> private void btn_start_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tb_localPort.Text) || string.IsNullOrEmpty(tb_localPort.Text) || null == _agwBus) { return; } var res = _agwBus.StartRecordScreen(); Log4NetHelper.ActionLog("Agw", "StartRecordScreen", res); }
/// <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(); }
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; }
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")); } } }
/// <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); } }
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 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); } }
/// <summary> /// initial vrc component /// </summary> /// <param name="agentId">agengID</param> /// <returns>initail result</returns> private bool InitialVrcComponent(string agentId) { var iniRes = false; try { _isVrcInitalized = true; if (null == _agwBus || null == _vrc) { return(false); } var token = _agwBus.QryCurrentAgentRecordToken(); if (string.IsNullOrEmpty(token)) { Log4NetHelper.ActionLog("Agw", "QryRecordToken", "failed"); return(false); } var recordType = rb_single.IsChecked.Value == true ? RCDTYPE_SINGLE : RCDTYPE_TWO; var parm = string.Format("screenNo={0};recordType={1};mainScreenX={2};mainScreenY={3};subScreenX={4};subScreenY={5}", tb_screenNo.Text, recordType, DEFAULT_SIZE, DEFAULT_SIZE, DEFAULT_SIZE, DEFAULT_SIZE); var setRes = _vrc.SetRecordParam(parm) + ""; Log4NetHelper.ActionLog("Vrc", "SetRecordParam", setRes); int port = 0; Int32.TryParse(tb_localPort.Text, out port); var iniAgentRes = _vrc.InitializeAgentEx(tb_vrpList.Text + " ", VRC_LOGINTYPE, agentId, tb_localIP.Text, port, "", token) + ""; Log4NetHelper.ActionLog("Vrc", "InitializeAgentEx", iniAgentRes); iniRes = AGWErrorCode.OK.Equals(iniAgentRes); } catch (Exception exc) { Log4NetHelper.ExcepLog("Common", "StartRecordScreen", exc.Message); return(false); } return(iniRes); }
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; }
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; }