/// <summary> /// 转发结果(ok/fail) /// </summary> /// <param name="p"></param> private void TransmissionResult(string msg) { if (msg.Equals("ok")) { SocketCls.listenEvent -= SocketCls_listenEvent; CloseTaskWindow.Dispatcher.Invoke(new Action(() => { CloseTaskWindow.FormState = 2; CloseTaskWindow.Close(); })); } else { System.Windows.MessageBox.Show("转发坐席失败,请确保此坐席已登录并处于【空闲】"); #region 日志 LogModel log = new LogModel() { CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Direction = LogConstParam.Directions_OutIn, FunctionName = "坐席任务处理_关闭窗体_转发坐席后的反馈结果", Level = LogConstParam.LogLevel_Error, Msg = "转发坐席失败,请确保此坐席已登录并处于【空闲】", Data = msg, Origin = LoginUser.Role.Name, OperateUserName = LoginUser.Name }; Talent.ClinetLog.SysLog.Log(JsonConvert.SerializeObject(log)); #endregion } }
/// <summary> /// 选择坐席后转发他人业务实现 /// </summary> private void Button_Click(object sender, RoutedEventArgs e) { Button b = sender as Button; var list = (from r in Seats where r.seatname == b.Content.ToString().Trim() select r).ToList(); if (list.Count > 0) { var data = new { clientid = this.clientId, newseatid = list.First().seatid }; string paramJson = Talent.CommonMethod.InfoExchange.ToJson(data); try { SocketCls.Emit(SeatlistenCmdEnum.redirectTask, paramJson); this.Focus(); #region 写日志 LogModel log = new LogModel() { Origin = LoginUser.Role.Name, FunctionName = "坐席任务处理窗体_关闭窗体_任务转发_选择坐席后转发他人业务实现", Level = LogConstParam.LogLevel_Info, Direction = LogConstParam.Directions_Out, Msg = "发送转发任务命令【" + SeatlistenCmdEnum.redirectTask + "】给任务服务器", Data = data, IsDataValid = LogConstParam.DataValid_Ok, ParamList = new List <DataParam>() { new DataParam() { ParamName = "clientid", ParamValue = this.clientId }, new DataParam() { ParamName = "newseatid", ParamValue = list.First().equcode } }, CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), OperateUserName = LoginUser.Name }; Talent.ClinetLog.SysLog.Log(JsonConvert.SerializeObject(log)); #endregion //转发之后自动关闭,去掉等待…… CloseTaskWindow.Dispatcher.Invoke(new Action(() => { CloseTaskWindow.FormState = 2; CloseTaskWindow.Close(); })); } catch (Exception) { System.Windows.Forms.MessageBox.Show("任务转发失败,请确认与任务服务器连接是否正常!"); #region 写日志 LogModel log = new LogModel() { Origin = LoginUser.Role.Name, FunctionName = "坐席任务处理窗体_关闭窗体_任务转发_选择坐席后转发他人业务实现", Level = LogConstParam.LogLevel_Error, Direction = LogConstParam.Directions_Out, Msg = "发送转发任务命令【" + SeatlistenCmdEnum.redirectTask + "】给任务服务器失败.", Data = data, IsDataValid = LogConstParam.DataValid_Ok, ParamList = new List <DataParam>() { new DataParam() { ParamName = "clientid", ParamValue = this.clientId }, new DataParam() { ParamName = "newseatid", ParamValue = list.First().equcode } }, CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), OperateUserName = LoginUser.Name }; Talent.ClinetLog.SysLog.Log(JsonConvert.SerializeObject(log)); #endregion } } }