public void InitQueryDetail() { ListQueryItems.Clear(); try { //获取查询设置参数表 WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S3107Codes.GetQueryDetail; Service31071Client client = new Service31071Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31071")); WebReturn webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { return; } if (webReturn.ListData.Count <= 0) { return; } for (int i = 0; i < webReturn.ListData.Count; i++) { OperationReturn optReturn = XMLHelper.DeserializeObject <QuerySettingItems>(webReturn.ListData[i]); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); continue; } QuerySettingItems queryItem = optReturn.Data as QuerySettingItems; if (queryItem == null) { ShowException(string.Format("Fail. queryItem is null")); return; } queryItem.RowNumber = i + 1; queryItem.strUsed = queryItem.IsUsed == "Y" ? CurrentApp.GetLanguageInfo("3107T00011", queryItem.IsUsed) : CurrentApp.GetLanguageInfo("3107T00012", queryItem.IsUsed); switch (queryItem.CallDirection) { case "2": queryItem.StrCall = CurrentApp.GetLanguageInfo("3107T00033", queryItem.CallDirection); break; case "0": //呼出 queryItem.StrCall = CurrentApp.GetLanguageInfo("3107T00035", queryItem.CallDirection); break; case "1": queryItem.StrCall = CurrentApp.GetLanguageInfo("3107T00034", queryItem.CallDirection); break; } queryItem.StrAssT = CurrentApp.GetLanguageInfo(string.Format("3107T0004{0}", queryItem.AgentAssType), queryItem.AgentAssType.ToString()); ListQueryItems.Add(queryItem); } } catch (Exception ex) { ShowException(ex.Message); } }
public void InitControledAgentAndOrg(string OrgID) { try { WebRequest webRequest = new WebRequest(); webRequest.Session = Session; webRequest.Code = (int)S3107Codes.GetControlOrgInfoList; webRequest.ListData.Add(Session.UserID.ToString()); webRequest.ListData.Add(OrgID); //Service31071Client client = new Service31071Client(); Service31071Client client = new Service31071Client(WebHelper.CreateBasicHttpBinding(Session), WebHelper.CreateEndpointAddress(Session.AppServerInfo, "Service31071")); //WebHelper.SetServiceClient(client); WebReturn webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { ShowExceptionMessage(string.Format("Fail.\tListData is null")); return; } for (int i = 0; i < webReturn.ListData.Count; i++) { string strInfo = webReturn.ListData[i]; string[] arrInfo = strInfo.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.RemoveEmptyEntries); if (arrInfo.Length < 3) { continue; } CtrolOrg ctrolOrg = new CtrolOrg(); ctrolOrg.ID = arrInfo[0]; ctrolOrg.OrgName = arrInfo[1]; ctrolOrg.OrgParentID = arrInfo[2]; if (OrgID.Equals("-1")) { CurrentOrg = ctrolOrg.OrgParentID; } if (ListCtrolOrgInfos.Where(p => p.ID == ctrolOrg.ID).Count() == 0) { ListCtrolOrgInfos.Add(ctrolOrg); } InitControledAgentAndOrg(arrInfo[0]); InitControlQA(arrInfo[0]); InitControlAgents(arrInfo[0]); InitControlRealityExtension(arrInfo[0]); InitControlExtension(arrInfo[0]); } } catch (Exception ex) { ShowExceptionMessage(ex.Message); } }
/// <summary> /// 座席过多的情况下,匹配所选座席的交集效率太慢。所以,目前查出所有可用评分表,自动任务在任务中特殊处理 /// </summary> private void GetTemplate() { try { WebRequest webRequest = new WebRequest(); webRequest.Code = (int)S3107Codes.GetAgentsTemplate; webRequest.Session = CurrentApp.Session; //webRequest.ListData.Add(agentIDStr);//这句是找到每条录音记录的坐席 int aaa = webRequest.ListData.Count; Service31071Client client = new Service31071Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31071")); WebReturn webReturn = client.UMPTaskOperation(webRequest); client.Close(); //string strtemp = webReturn.ListData[0]; if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { ShowException(string.Format("Fail.\tListData is null")); return; } ComboBoxItem item; for (int i = 0; i < webReturn.ListData.Count; i++) { if (!string.IsNullOrWhiteSpace(webReturn.ListData[i])) { string[] array = webReturn.ListData[i].Split(';'); OperationInfo info = new OperationInfo(); info.ID = Convert.ToInt64(array[0]); info.Description = array[1]; item = new ComboBoxItem(); item.DataContext = info; item.Content = array[1]; cbTemplate.Items.Add(item); if (TaskItems != null && TaskItems.TemplateID > 0 && TaskItems.TemplateID == info.ID) { cbTemplate.SelectedIndex = i; ckTemplate.IsChecked = true; } } } } catch (Exception ex) { ShowException(ex.Message); } }
void GetKeyWord() { try { S3107App.ListKeyWordItems.Clear(); WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S3107Codes.GetKeyWordItems; Service31071Client client = new Service31071Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31071")); WebHelper.SetServiceClient(client); WebReturn webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { ShowException(string.Format("Fail.\tListData is null")); return; } OperationReturn optReturn; for (int i = 0; i < webReturn.ListData.Count; i++) { string strInfo = webReturn.ListData[i]; optReturn = XMLHelper.DeserializeObject <KeyWordItems>(strInfo); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } KeyWordItems info = optReturn.Data as KeyWordItems; if (info == null) { ShowException(string.Format("KeywordInfo is null.")); return; } S3107App.ListKeyWordItems.Add(info); } } catch (Exception ex) { ShowException(ex.Message); } }
void GetRateDetail() { try { if (TaskItems.TaskSettingID <= 0) { return; } TaskRate = new List <TaskDurationRate>(); WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S3107Codes.GetRateDetail; webRequest.ListData.Add(TaskItems.TaskSettingID.ToString()); Service31071Client client = new Service31071Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31071")); WebReturn webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { return; } if (webReturn.ListData.Count <= 0) { return; } for (int i = 0; i < webReturn.ListData.Count; i++) { OperationReturn optReturn = XMLHelper.DeserializeObject <TaskDurationRate>(webReturn.ListData[i]); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); continue; } TaskDurationRate rateItem = optReturn.Data as TaskDurationRate; if (rateItem == null) { ShowException(string.Format("Fail. rateItem is null")); return; } TaskRate.Add(rateItem); } } catch (Exception ex) { ShowException(ex.Message); } }
private void InitControlQA(string parentID) { try { WebRequest webRequest = new WebRequest(); webRequest.Session = Session; webRequest.Code = (int)S3107Codes.GetQA; webRequest.ListData.Add(parentID); webRequest.ListData.Add("3103005");//任务中评分权限 //Service31071Client client = new Service31071Client(); Service31071Client client = new Service31071Client(WebHelper.CreateBasicHttpBinding(Session), WebHelper.CreateEndpointAddress(Session.AppServerInfo, "Service31071")); //WebHelper.SetServiceClient(client); WebReturn webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { ShowExceptionMessage(string.Format("Fail.\tListData is null")); return; } for (int i = 0; i < webReturn.ListData.Count; i++) { string strInfo = webReturn.ListData[i]; OperationReturn optReturn = XMLHelper.DeserializeObject <CtrolQA>(webReturn.ListData[i]); if (!optReturn.Result) { ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } CtrolQA ctrolQa = optReturn.Data as CtrolQA; if (ctrolQa != null) { ListCtrolQAInfos.Add(ctrolQa); } } } catch (Exception ex) { ShowExceptionMessage(ex.Message); } }
void DeleteDBO(QuerySettingItems Item) { try { string strLog; WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S3107Codes.DeleteDBO; webRequest.ListData.Add(Item.QuerySettingID.ToString()); Service31071Client client = new Service31071Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31071")); //Service31071Client client = new Service31071Client(); WebReturn webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(CurrentApp.GetLanguageInfo("3107T00092", "Delete Failed")); #region 写操作日志 strLog = string.Format("{0} {1}{2}", Utils.FormatOptLogString("3107T00005"), Utils.FormatOptLogString("3107T00028"), Item.QuerySettingName); CurrentApp.WriteOperationLog(S3107Consts.OPT_AutoTask.ToString(), ConstValue.OPT_RESULT_FAIL, strLog); #endregion return; } if (webReturn.Message == S3107Consts.HadUse)// 该查询条件被使用无法删除 { ShowInformation(CurrentApp.GetLanguageInfo("3107T00093", "Can't Delete")); return; } else { ListQueryItems.Remove(Item); ShowInformation(CurrentApp.GetLanguageInfo("3107T00091", "Delete Sucessed")); CreatoptButtons(); #region 写操作日志 strLog = string.Format("{0} {1}{2}", Utils.FormatOptLogString("3107T00005"), Utils.FormatOptLogString("3107T00028"), Item.QuerySettingName); CurrentApp.WriteOperationLog(S3107Consts.OPT_AutoTask.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog); #endregion } } catch (Exception ex) { ShowException(ex.Message); } }
public void InitTaskDetail() { ListTaskItems.Clear(); try { //获取查询设置参数表 WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S3107Codes.GetTaskDetail; Service31071Client client = new Service31071Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31071")); WebReturn webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}", webReturn.Message)); return; } if (webReturn.ListData.Count <= 0) { return; } for (int i = 0; i < webReturn.ListData.Count; i++) { OperationReturn optReturn = XMLHelper.DeserializeObject <TaskSettingItems>(webReturn.ListData[i]); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); continue; } TaskSettingItems taskItem = optReturn.Data as TaskSettingItems; if (taskItem == null) { ShowException(string.Format("Fail. taskItem is null")); return; } taskItem.RowNumber = i + 1; taskItem.StrTaskType = CurrentApp.GetLanguageInfo(string.Format("3107T0004{0}", taskItem.TaskType + 3), taskItem.TaskType.ToString()); taskItem.StrStatus = taskItem.Status == "Y" ? CurrentApp.GetLanguageInfo("3107T00011", taskItem.Status) : CurrentApp.GetLanguageInfo("3107T00012", taskItem.Status); switch (taskItem.RunFreq) { case "D": taskItem.StrRunFreq = CurrentApp.GetLanguageInfo("3107T00072", taskItem.RunFreq); break; case "W": taskItem.StrRunFreq = CurrentApp.GetLanguageInfo("3107T00060", taskItem.RunFreq); break; case "M": taskItem.StrRunFreq = CurrentApp.GetLanguageInfo("3107T00061", taskItem.RunFreq); break; case "S": taskItem.StrRunFreq = CurrentApp.GetLanguageInfo("3107T00062", taskItem.RunFreq); break; case "Y": taskItem.StrRunFreq = CurrentApp.GetLanguageInfo("3107T00063", taskItem.RunFreq); break; } ListTaskItems.Add(taskItem); } } catch (Exception ex) { ShowException(ex.Message); } }
private bool TaskDBOperation() { bool flag = true; WebRequest webRequest; Service31071Client client; WebReturn webReturn; try { if (!S3107App.TaskModify)//新建數據需要獲取任務分配ID、運行週期ID { //生成新的任务分配ID webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.WSGetSerialID; webRequest.ListData.Add("31"); webRequest.ListData.Add("372"); webRequest.ListData.Add(DateTime.Now.ToString("yyyyMMddHHmmss")); client = new Service31071Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31071")); webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { return(false); } string strNewResultID = webReturn.Data; if (string.IsNullOrEmpty(strNewResultID)) { ShowException(CurrentApp.GetLanguageInfo("3107T00082", "strNewResultID1 Is Null")); return(false); } TaskItems.TaskSettingID = Convert.ToInt64(strNewResultID); //生成新的运行周期ID webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.WSGetSerialID; webRequest.ListData.Add("31"); webRequest.ListData.Add("313"); webRequest.ListData.Add(DateTime.Now.ToString("yyyyMMddHHmmss")); client = new Service31071Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31071")); webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { return(false); } strNewResultID = webReturn.Data; if (string.IsNullOrEmpty(strNewResultID)) { ShowException(CurrentApp.GetLanguageInfo("3107T00082", "strNewResultID2 Is Null")); return(false); } TaskItems.FrequencyID = Convert.ToInt64(strNewResultID); } //往任务设置中插入用户信息 TaskItems.Creator = CurrentApp.Session.UserID; TaskItems.CreatorName = CurrentApp.Session.UserInfo.UserName; #region 时长分配比率 T_31_048 在插入数据库时获取自动任务分配ID时读取 TaskRate = new List <TaskDurationRate>(); if (ckDataGrid.IsChecked == true) { if (dataGrid.Items.Count < 0) { return(false); } TaskDurationRate rateItem; double ratecount = 0.0; foreach (DataGridInfo tempRate in dataGrid.ItemsSource) { rateItem = new TaskDurationRate(); rateItem.DurationMin = tempRate.DurationMin; rateItem.DurationMax = tempRate.DurationMax; if (tempRate.DurationMin > tempRate.DurationMax) { ShowInformation(CurrentApp.GetLanguageInfo("3107T00085", "Please Input Right Duration")); return(false); } rateItem.Rate = tempRate.Rate; rateItem.TaskSettingID = TaskItems.TaskSettingID; ratecount += tempRate.Rate; TaskRate.Add(rateItem); } if (ratecount != 100.0) { ShowInformation(CurrentApp.GetLanguageInfo("3107T00085", "Please Input Right Duration")); return(false); } } #endregion //往T_31_023、T_31_026、T_31_048中插入数据 webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S3107Codes.TaskSettingDBO; OperationReturn optReturn = XMLHelper.SeriallizeObject(TaskItems);//任务设置 0 if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return(false); } webRequest.ListData.Add(optReturn.Data.ToString()); string tempFlag = S3107App.TaskModify == true ? "T" : "F"; webRequest.ListData.Add(tempFlag); // 1 webRequest.ListData.Add(TaskRate.Count.ToString()); //2 if (TaskRate.Count > 0 && ckDataGrid.IsChecked == true) { for (int i = 0; i < TaskRate.Count; i++) { optReturn = XMLHelper.SeriallizeObject(TaskRate[i]); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return(false); } webRequest.ListData.Add(optReturn.Data.ToString());//时长比率 2+i } } client = new Service31071Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31071")); webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { return(false); } } catch (Exception ex) { ShowException(ex.Message); return(false); } return(flag); }