コード例 #1
0
        private bool CreateQueryCondition()
        {
            bool flag = true;

            try
            {
                mListSubItems.Clear();
                mListQueryConditionDetails.Clear();
                mListCtrolAgent.Clear();
                //匹配纯数字的
                string pattern = @"^\d+$";
                //時間範圍
                if (!CheckInput())
                {
                    return(false);
                }

                DateTimeReturn();
                DateTimeSpliteAsDay dateTimeSpliteAsDay = new DateTimeSpliteAsDay();
                dateTimeSpliteAsDay.StartDayTime = DateTime.Parse(DateStart.Value.ToString()).ToUniversalTime();
                dateTimeSpliteAsDay.StopDayTime  = DateTime.Parse(DateStop.Value.ToString()).ToUniversalTime();
                mListDateTime.Add(dateTimeSpliteAsDay);

                QueryConditionDetail querycontionDetail = new QueryConditionDetail();

                //最近時間
                querycontionDetail = new QueryConditionDetail();
                querycontionDetail.ConditionItemID = S3104Consts.CON_TIMEFROMTO;
                querycontionDetail.IsEnable        = true;
                querycontionDetail.Value01         = DateTime.Parse(DateStart.Value.ToString()).ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                querycontionDetail.Value02         = DateTime.Parse(DateStop.Value.ToString()).ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                mListQueryConditionDetails.Add(querycontionDetail);

                //if (rdbTime1.IsChecked.Equals(true))
                //{
                //}

                //if (rdbTime2.IsChecked.Equals(true))
                //{
                //    querycontionDetail = new QueryConditionDetail();
                //    querycontionDetail.ConditionItemID = S3104Consts.CON_TIMEFROMTO;
                //    querycontionDetail.IsEnable = true;
                //    querycontionDetail.Value01 = DateTime.Parse(DateStart.Value.ToString()).ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                //    querycontionDetail.Value02 = DateTime.Parse(DateStop.Value.ToString()).ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                //    mListQueryConditionDetails.Add(querycontionDetail);
                //}

                //录音时长
                if (chkEnableLengthTime.IsChecked.Equals(true))
                {
                    querycontionDetail = new QueryConditionDetail();
                    querycontionDetail.ConditionItemID = S3104Consts.CON_DURATIONFROMTO;
                    querycontionDetail.IsEnable        = true;
                    querycontionDetail.Value01         = Converter.Time2Second(mtbStart.Text).ToString();
                    querycontionDetail.Value02         = Converter.Time2Second(mtbStop.Text).ToString();
                    mListQueryConditionDetails.Add(querycontionDetail);
                }

                //流水号
                if (chkEnableReference.IsChecked.Equals(true))
                {
                    if (chkRecordReference.IsChecked.Equals(true) && txtRecordReference.Text.Trim(' ').Length > 0)
                    {
                        Match m = Regex.Match(txtRecordReference.Text.Trim(' ').ToString(), pattern);
                        if (m.Success)
                        {
                            querycontionDetail = new QueryConditionDetail();
                            querycontionDetail.ConditionItemID = S3104Consts.CON_RECORDREFERENCE_MULTITEXT;
                            querycontionDetail.IsEnable        = true;
                            querycontionDetail.IsLike          = true;
                            querycontionDetail.Value01         = txtRecordReference.Text.Trim(' ').ToString();
                            mListQueryConditionDetails.Add(querycontionDetail);
                        }
                        else
                        {
                            App.ShowExceptionMessage(App.GetLanguageInfo("3104T00125", "RecordReference Is Not Legal"));
                            return(false);
                        }
                    }
                    else if (chkRecordReference.IsChecked.Equals(false) && txtRecordReference.Text.Trim(' ').Length > 0)
                    {
                        string[] values = txtRecordReference.Text.Trim(' ').ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        for (int i = 0; i < values.Length; i++)
                        {
                            Match m = Regex.Match(values[i], pattern);
                            if (!m.Success)
                            {
                                App.ShowExceptionMessage(App.GetLanguageInfo("3104T00125", "RecordReference Is Not Legal"));
                                return(false);
                            }
                        }

                        querycontionDetail = new QueryConditionDetail();
                        querycontionDetail.ConditionItemID = S3104Consts.CON_RECORDREFERENCE_MULTITEXT;
                        querycontionDetail.IsEnable        = true;
                        querycontionDetail.IsLike          = false;
                        mListQueryConditionDetails.Add(querycontionDetail);
                        SetSubItem(S3104Consts.CON_RECORDREFERENCE_MULTITEXT, txtRecordReference.Text.Trim(' ').ToString());
                    }
                }



                //caller
                if (chkEnableCaller.IsChecked.Equals(true))
                {
                    if (chkCaller.IsChecked.Equals(true) && txtCaller.Text.Trim(' ').Length > 0)
                    {
                        querycontionDetail = new QueryConditionDetail();
                        querycontionDetail.ConditionItemID = S3104Consts.CON_CALLERID_LIKETEXT;
                        querycontionDetail.IsEnable        = true;
                        querycontionDetail.IsLike          = true;
                        querycontionDetail.Value01         = txtCaller.Text.Trim(' ').ToString();
                        mListQueryConditionDetails.Add(querycontionDetail);
                    }
                    else if (chkCaller.IsChecked.Equals(false) && txtCaller.Text.Trim(' ').Length > 0)
                    {
                        querycontionDetail = new QueryConditionDetail();
                        querycontionDetail.ConditionItemID = S3104Consts.CON_CALLERID_LIKETEXT;
                        querycontionDetail.IsEnable        = true;
                        querycontionDetail.IsLike          = false;
                        mListQueryConditionDetails.Add(querycontionDetail);
                        SetSubItem(S3104Consts.CON_CALLERID_LIKETEXT, txtCaller.Text.Trim(' ').ToString());
                    }
                }

                //called
                if (chkEnableCalledID.IsChecked.Equals(true))
                {
                    if (chkCalled.IsChecked.Equals(true) && txtCalled.Text.Trim(' ').Length > 0)
                    {
                        querycontionDetail = new QueryConditionDetail();
                        querycontionDetail.ConditionItemID = S3104Consts.CON_CALLEDID_LIKETEXT;
                        querycontionDetail.IsEnable        = true;
                        querycontionDetail.IsLike          = true;
                        querycontionDetail.Value01         = txtCalled.Text.Trim(' ').ToString();
                        mListQueryConditionDetails.Add(querycontionDetail);
                    }
                    else if (chkCalled.IsChecked.Equals(false) && txtCalled.Text.Trim(' ').Length > 0)
                    {
                        querycontionDetail = new QueryConditionDetail();
                        querycontionDetail.ConditionItemID = S3104Consts.CON_CALLEDID_LIKETEXT;
                        querycontionDetail.IsEnable        = true;
                        querycontionDetail.IsLike          = false;
                        mListQueryConditionDetails.Add(querycontionDetail);
                        SetSubItem(S3104Consts.CON_CALLEDID_LIKETEXT, txtCalled.Text.Trim(' ').ToString());
                    }
                }

                //chanel
                if (chkEnableChanel.IsChecked.Equals(true))
                {
                    if (chkChanle.IsChecked.Equals(true) && txtChanle.Text.Trim(' ').Length > 0)
                    {
                        Match m = Regex.Match(txtChanle.Text.Trim(' ').ToString(), pattern);
                        if (m.Success)
                        {
                            querycontionDetail = new QueryConditionDetail();
                            querycontionDetail.ConditionItemID = S3104Consts.CON_CHANNELID_MULTITEXT;
                            querycontionDetail.IsEnable        = true;
                            querycontionDetail.IsLike          = true;
                            querycontionDetail.Value01         = txtChanle.Text.Trim(' ').ToString();
                            mListQueryConditionDetails.Add(querycontionDetail);
                        }
                        else
                        {
                            App.ShowExceptionMessage(App.GetLanguageInfo("3104T00126", "Channel Is Not Legal"));
                            return(false);
                        }
                    }
                    else if (chkChanle.IsChecked.Equals(false) && txtChanle.Text.Trim(' ').Length > 0)
                    {
                        string[] values = txtChanle.Text.Trim(' ').ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        for (int i = 0; i < values.Length; i++)
                        {
                            Match m = Regex.Match(values[i], pattern);
                            if (!m.Success)
                            {
                                App.ShowExceptionMessage(App.GetLanguageInfo("3104T00126", "Channel Is Not Legal"));
                                return(false);
                            }
                        }

                        querycontionDetail = new QueryConditionDetail();
                        querycontionDetail.ConditionItemID = S3104Consts.CON_CHANNELID_MULTITEXT;
                        querycontionDetail.IsEnable        = true;
                        querycontionDetail.IsLike          = false;
                        mListQueryConditionDetails.Add(querycontionDetail);
                        SetSubItem(S3104Consts.CON_CHANNELID_MULTITEXT, txtChanle.Text.Trim(' ').ToString());
                    }
                }


                //cti
                //if (chkEnableCTIReference.IsChecked.Equals(true))
                //{
                //    if (chkCTIReference.IsChecked.Equals(true) && txtCTIReference.Text.Trim(' ').Length > 0)
                //    {
                //        querycontionDetail = new QueryConditionDetail();
                //        querycontionDetail.ConditionItemID = S3104Consts.CON_CTIREFERENCE_MULTITEXT;
                //        querycontionDetail.IsEnable = true;
                //        querycontionDetail.IsLike = true;
                //        querycontionDetail.Value01 = txtChanle.Text.Trim(' ').ToString();
                //        mListQueryConditionDetails.Add(querycontionDetail);
                //    }
                //    else if (chkCTIReference.IsChecked.Equals(false) && txtCTIReference.Text.Trim(' ').Length > 0)
                //    {
                //        querycontionDetail = new QueryConditionDetail();
                //        querycontionDetail.ConditionItemID = S3104Consts.CON_CTIREFERENCE_MULTITEXT;
                //        querycontionDetail.IsEnable = true;
                //        querycontionDetail.IsLike = false;
                //        mListQueryConditionDetails.Add(querycontionDetail);
                //        SetSubItem(S3104Consts.CON_CTIREFERENCE_MULTITEXT, txtChanle.Text.Trim(' ').ToString());
                //    }
                //}


                //call direction
                if (rabDirectionIn.IsChecked.Equals(true))
                {
                    querycontionDetail = new QueryConditionDetail();
                    querycontionDetail.ConditionItemID = S3104Consts.CON_DIRECTION;
                    querycontionDetail.IsEnable        = true;
                    querycontionDetail.IsLike          = false;
                    querycontionDetail.Value01         = "1";
                    mListQueryConditionDetails.Add(querycontionDetail);
                }
                else if (rabDirectionOut.IsChecked.Equals(true))
                {
                    querycontionDetail = new QueryConditionDetail();
                    querycontionDetail.ConditionItemID = S3104Consts.CON_DIRECTION;
                    querycontionDetail.IsEnable        = true;
                    querycontionDetail.IsLike          = false;
                    querycontionDetail.Value01         = "0";
                    mListQueryConditionDetails.Add(querycontionDetail);
                }


                //查申诉
                if (chkAppeal.IsChecked.Equals(true))
                {
                    querycontionDetail = new QueryConditionDetail();
                    querycontionDetail.ConditionItemID = S3104Consts.CON_HasAppeal;
                    querycontionDetail.IsEnable        = true;
                    querycontionDetail.IsLike          = false;
                    querycontionDetail.Value01         = "1";
                    mListQueryConditionDetails.Add(querycontionDetail);
                }


                //查是否评分
                if (chkScore.IsChecked.Equals(true))
                {
                    querycontionDetail = new QueryConditionDetail();
                    querycontionDetail.ConditionItemID = S3104Consts.CON_HasScore;
                    querycontionDetail.IsEnable        = true;
                    querycontionDetail.IsLike          = false;
                    querycontionDetail.Value01         = "1";
                    mListQueryConditionDetails.Add(querycontionDetail);
                }

                //查是否有书签
                if (chkBookMark.IsChecked.Equals(true))
                {
                    querycontionDetail = new QueryConditionDetail();
                    querycontionDetail.ConditionItemID = S3104Consts.CON_BookMark;
                    querycontionDetail.IsEnable        = true;
                    querycontionDetail.IsLike          = false;
                    querycontionDetail.Value01         = "1";
                    mListQueryConditionDetails.Add(querycontionDetail);
                }

                #region ABCD
                //ABCD查询项--服务态度
                if (chkServiceAttitude.IsChecked.Equals(true))
                {
                    if (cbSvAttitude.SelectedIndex < 0)
                    {
                        App.ShowInfoMessage(App.GetLanguageInfo("3104T00171", "Select One Org"));
                        return(false);
                    }
                    querycontionDetail = new QueryConditionDetail();
                    querycontionDetail.ConditionItemID = Convert.ToInt64(S3104Consts.WDE_ServiceAttitude);
                    querycontionDetail.IsEnable        = true;
                    querycontionDetail.IsLike          = false;
                    if (rbSAGood.IsChecked.Equals(true))//1 好
                    {
                        querycontionDetail.Value01 = "1";
                    }
                    else if (rbSABad.IsChecked.Equals(true))//2 坏
                    {
                        querycontionDetail.Value01 = "2";
                    }
                    else if (rbSAAll.IsChecked.Equals(true))//0 全部(1,2)
                    {
                        querycontionDetail.Value01 = "0";
                    }
                    if (string.IsNullOrWhiteSpace(querycontionDetail.Value01))//如果没有选择哪一项,默认勾选全部
                    {
                        rbSAAll.IsChecked          = true;
                        querycontionDetail.Value01 = "0";
                    }
                    querycontionDetail.Value02 = ListSVABCDItem[cbSvAttitude.SelectedIndex].InColumn.ToString();
                    querycontionDetail.Value03 = string.Format("SV");
                    mListQueryConditionDetails.Add(querycontionDetail);
                }
                //ABCD查询项--专业水平
                if (chkProfessionalLevel.IsChecked.Equals(true))
                {
                    if (cbProLevel.SelectedIndex < 0)
                    {
                        App.ShowInfoMessage(App.GetLanguageInfo("3104T00171", "Select One Org"));
                        return(false);
                    }
                    querycontionDetail = new QueryConditionDetail();
                    querycontionDetail.ConditionItemID = Convert.ToInt64(S3104Consts.WDE_ProfessionalLevel);
                    querycontionDetail.IsEnable        = true;
                    querycontionDetail.IsLike          = false;
                    if (rbPLGood.IsChecked.Equals(true))//1 好
                    {
                        querycontionDetail.Value01 = "1";
                    }
                    else if (rbPLBad.IsChecked.Equals(true))//2 坏
                    {
                        querycontionDetail.Value01 = "2";
                    }
                    else if (rbPLAll.IsChecked.Equals(true))//0 全部(1,2)
                    {
                        querycontionDetail.Value01 = "0";
                    }
                    if (string.IsNullOrWhiteSpace(querycontionDetail.Value01))//如果没有选择哪一项,默认勾选全部
                    {
                        rbPLAll.IsChecked          = true;
                        querycontionDetail.Value01 = "0";
                    }
                    querycontionDetail.Value02 = ListProLABCDItem[cbProLevel.SelectedIndex].InColumn.ToString();
                    querycontionDetail.Value03 = string.Format("ProL");
                    mListQueryConditionDetails.Add(querycontionDetail);
                }
                //ABCD查询项--录音时长异常
                if (chkRecordDurationError.IsChecked.Equals(true))
                {
                    if (cbRDError.SelectedIndex < 0)
                    {
                        App.ShowInfoMessage(App.GetLanguageInfo("3104T00171", "Select One Org"));
                        return(false);
                    }
                    querycontionDetail = new QueryConditionDetail();
                    querycontionDetail.ConditionItemID = Convert.ToInt64(S3104Consts.WDE_RecordDurationError);
                    querycontionDetail.IsEnable        = true;
                    querycontionDetail.IsLike          = false;
                    if (rbRDGood.IsChecked.Equals(true))//1 正常
                    {
                        querycontionDetail.Value01 = "1";
                    }
                    else if (rbRDBad.IsChecked.Equals(true))//2 异常
                    {
                        querycontionDetail.Value01 = "2";
                    }
                    else if (rbRDAll.IsChecked.Equals(true))//0 全部(1,2)
                    {
                        querycontionDetail.Value01 = "0";
                    }
                    if (string.IsNullOrWhiteSpace(querycontionDetail.Value01))//如果没有选择哪一项,默认勾选全部
                    {
                        rbRDAll.IsChecked          = true;
                        querycontionDetail.Value01 = "0";
                    }
                    querycontionDetail.Value02 = ListRDEABCDItem[cbRDError.SelectedIndex].InColumn.ToString();
                    querycontionDetail.Value03 = string.Format("RoDE");

                    mListQueryConditionDetails.Add(querycontionDetail);
                }
                //ABCD查询项--重复呼入
                if (chkRepeatCallIn.IsChecked.Equals(true))
                {
                    if (cbRepeatCallIn.SelectedIndex < 0)
                    {
                        App.ShowInfoMessage(App.GetLanguageInfo("3104T00171", "Select One Org"));
                        return(false);
                    }
                    querycontionDetail = new QueryConditionDetail();
                    querycontionDetail.ConditionItemID = Convert.ToInt64(S3104Consts.WDE_RepeatCallIn);
                    querycontionDetail.IsEnable        = true;
                    querycontionDetail.IsLike          = false;
                    if (rbRCNo.IsChecked.Equals(true))//1 非重复呼入
                    {
                        querycontionDetail.Value01 = "1";
                    }
                    else if (rbRCYes.IsChecked.Equals(true))//2 重复呼入
                    {
                        querycontionDetail.Value01 = "2";
                    }
                    else if (rbRCAll.IsChecked.Equals(true))//0 全部(1,2)
                    {
                        querycontionDetail.Value01 = "0";
                    }
                    if (string.IsNullOrWhiteSpace(querycontionDetail.Value01))//如果没有选择哪一项,默认勾选全部
                    {
                        rbRCAll.IsChecked          = true;
                        querycontionDetail.Value01 = "0";
                    }
                    querycontionDetail.Value02 = ListRCIABCDItem[cbRepeatCallIn.SelectedIndex].InColumn.ToString();
                    querycontionDetail.Value03 = string.Format("ReCI");

                    mListQueryConditionDetails.Add(querycontionDetail);
                }



                #endregion

                StringBuilder sb = new StringBuilder();
                //可能没拿到值,座席名
                foreach (CtrolAgent c in App.ListCtrolAgentInfos)
                {
                    sb.Append(c.AgentName).Append(",");
                }

                querycontionDetail = new QueryConditionDetail();
                querycontionDetail.ConditionItemID = S3104Consts.CON_AGENT_MULTITEXT;
                querycontionDetail.IsEnable        = true;
                querycontionDetail.IsLike          = false;
                SetSubItem(S3104Consts.CON_AGENT_MULTITEXT, sb.ToString());
                mListQueryConditionDetails.Add(querycontionDetail);


                foreach (QueryConditionDetail detail in mListQueryConditionDetails)
                {
                    if (detail.IsEnable == true && detail.IsLike == false)
                    {
                        List <QueryConditionSubItem> listSubItems = mListSubItems.Where(p => p.ConditionItemID == detail.ConditionItemID).ToList();
                        if (listSubItems.Count > 0)
                        {
                            string Value01 = SaveMultiValues(listSubItems);
                            detail.Value01 = Value01;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                App.ShowExceptionMessage(ex.Message);
                return(false);
            }
            return(flag);
        }
コード例 #2
0
        private string CreateQueryCondition()
        {
            string strCondition = string.Empty;

            try
            {
                mListDateTime.Clear();
                //匹配纯数字的
                string pattern = @"^\d+$";
                //時間範圍
                if (!CheckInput())
                {
                    return(string.Empty);
                }
                DateTimeSpliteAsDay dateTimeSpliteAsDay = new DateTimeSpliteAsDay();
                dateTimeSpliteAsDay.StartDayTime = DateTime.Parse(DateStart.Value.ToString()).ToUniversalTime();
                dateTimeSpliteAsDay.StopDayTime  = DateTime.Parse(DateStop.Value.ToString()).ToUniversalTime();
                mListDateTime.Add(dateTimeSpliteAsDay);
                string timeStr = string.Empty;
                switch (CurrentApp.Session.DBType)
                {
                case 2:
                    timeStr = string.Format("T21.C005 >= '{0}' AND T21.C005 <= '{1}'",
                                            DateTime.Parse(DateStart.Value.ToString()).ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss"), DateTime.Parse(DateStop.Value.ToString()).ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss"));
                    break;

                case 3:
                    timeStr = string.Format("T21.C005 >=TO_DATE ('{0}','YYYY-MM-DD HH24:MI:SS') AND T21.C005 <=TO_DATE( '{1}','YYYY-MM-DD HH24:MI:SS')",
                                            DateTime.Parse(DateStart.Value.ToString()).ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss"), DateTime.Parse(DateStop.Value.ToString()).ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss"));
                    break;

                default:
                    ShowException(string.Format("DBType invalid"));
                    return(string.Empty);
                }

                //strCondition = string.Format("WHERE {0} AND T308.C009 = 'Y' ", timeStr);
                strCondition = string.Format("WHERE {0} ", timeStr);

                //if (chkScoreRange.IsChecked.Equals(true))
                //{
                //    bool isTrue = true;
                //    int min = 0;
                //    int max = 0;
                //    if (!string.IsNullOrWhiteSpace(txtScoreMin.Text.Trim()))
                //    {
                //        Match n = Regex.Match(txtScoreMin.Text.Trim(' '), pattern);
                //        if (n.Success) min = Convert.ToInt32(txtScoreMin.Text.Trim());
                //        else isTrue = false;
                //    }
                //    if (!String.IsNullOrWhiteSpace(txtScoreMax.Text.Trim()))
                //    {
                //        Match m = Regex.Match(txtScoreMax.Text.Trim(' '), pattern);
                //        if (m.Success) max = Convert.ToInt32(txtScoreMax.Text.Trim());
                //        else isTrue = false;
                //    }
                //    if (String.IsNullOrWhiteSpace(txtScoreMax.Text.Trim())||isTrue.Equals(false))
                //    {
                //        App.ShowExceptionMessage(string.Format(""));
                //        return string.Empty;
                //    }
                //    strCondition += string.Format("AND T308.C004 >= '{0}' AND T308.C004 <= '{1}' ", min, max);
                //}
                string         tempQa         = string.Empty;
                List <CtrolQA> lstCtrolQaTemp = new List <CtrolQA>();
                GetQAIsCheck(mRootQa, ref lstCtrolQaTemp);
                if (lstCtrolQaTemp.Count > 0)
                {
                    string stra = "";
                    foreach (CtrolQA ca in lstCtrolQaTemp)
                    {
                        stra += ca.UserID + ",";
                    }
                    stra   = stra.TrimEnd(',');
                    tempQa = stra;
                }
                if (!string.IsNullOrWhiteSpace(tempQa))
                {
                    strCondition += string.Format("AND T308.C005 IN ({0}) ", tempQa);
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
                return(string.Empty);
            }
            return(strCondition);
        }