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);
            }
        }
        void LvQueryCondition_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            QuerySettingItems Item = LvQueryCondition.SelectedItem as QuerySettingItems;

            if (Item != null)
            {
                CreatoptButtons();
            }
        }
 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);
     }
 }
Пример #4
0
        void cbTaskCondition_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            OperationInfo opt;
            string        keywordID      = string.Empty;
            string        keywordContent = string.Empty;
            var           temp           = cbTaskCondition.SelectedItem as ComboBoxItem;

            try
            {
                if (temp != null && queryItemList != null)
                {
                    mListCheckComItems.Clear();
                    opt = temp.DataContext as OperationInfo;
                    if (!string.IsNullOrWhiteSpace(queryItemList.Where(p => p.QuerySettingID == opt.ID).FirstOrDefault().LQKeyWordItemsOne))
                    {
                        QuerySettingItems tempq    = queryItemList.Where(p => p.QuerySettingID == opt.ID).FirstOrDefault();
                        string            keyIDStr = tempq.LQKeyWordItemsOne + tempq.LQKeyWordItemsTwo + tempq.LQKeyWordItemsThree;
                        var items = S3107App.ListKeyWordItems.GroupBy(k => k.KeyWordID);
                        lbKeyWord.Visibility = Visibility.Visible;
                        cbKeyWord.Visibility = Visibility.Visible;
                        cbKeyWord.Text       = string.Empty;
                        CheckComboboxItems chkCombItem;
                        if (TaskItems != null && !string.IsNullOrWhiteSpace(TaskItems.LQKeyWordItemsOne))
                        {
                            keywordID = TaskItems.LQKeyWordItemsOne + TaskItems.LQKeyWordItemsTwo + TaskItems.LQKeyWordItemsThree;
                        }
                        foreach (var item in items)
                        {
                            long   id      = 0;
                            string strName = string.Empty;
                            string strDesc = string.Empty;
                            foreach (var content in item)
                            {
                                id       = content.KeyWordID;
                                strName  = content.KeyWordSrt;
                                strDesc += string.Format("{0};", content.KWContent);
                            }
                            chkCombItem                = new CheckComboboxItems();
                            chkCombItem.KeyWordID      = id.ToString();
                            chkCombItem.Description    = string.Format("{0}({1})", strName, strDesc);
                            chkCombItem.KeyWordContent = strDesc;
                            if (keywordID.Contains(id.ToString()))
                            {
                                chkCombItem.IsSelected = true;
                                keywordContent        += strName + ",";
                            }
                            chkCombItem.KeyWordName = strName;
                            if (keyIDStr.Contains(id.ToString()))
                            {
                                mListCheckComItems.Add(chkCombItem);
                            }
                        }
                        if (!string.IsNullOrWhiteSpace(keywordContent))
                        {
                            if (keywordContent.Length > 9)
                            {
                                keywordContent = keywordContent.Substring(0, 9).TrimEnd(',') + "...";
                            }
                            cbKeyWord.Text = keywordContent.TrimEnd(',');
                        }
                    }
                    else
                    {
                        lbKeyWord.Visibility = Visibility.Collapsed;
                        cbKeyWord.Visibility = Visibility.Collapsed;
                    }
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }