Ejemplo n.º 1
0
        public void searchTitleByRecLog(ICollection <SearchLogResultItem> searchLogResults0)
        {
            try
            {
                using (SqlConnection sqlConn1 = new SqlConnection(sqlConnStr))
                {
                    sqlConn1.Open();
                    using (SqlCommand cmd1 = sqlConn1.CreateCommand())
                    {
                        foreach (var item1 in searchLogResults0)
                        {
                            if (item1.confirmed)
                            {
                                continue;
                            }
                            if (item1.recodeStatus != RecLogItem.RecodeStatuses.NONE)
                            {
                                continue;
                            }
                            //
                            string            tvProgramTitle1 = RecLogWindow.trimKeyword(item1.tvProgramTitle);
                            List <RecLogItem> recLogItems1;
                            switch (Settings.Instance.RecLog_SearchMethod)
                            {
                            case RecLogView.searchMethods.LIKE:
                                recLogItems1 = _db_RecLog.search_Like(cmd1, tvProgramTitle1, RecLogItem.RecodeStatuses.ALL, DB_RecLog.searchColumns.title, 1, item1.epgEventInfoR.ContentInfo);
                                break;

                            case RecLogView.searchMethods.Contrains:
                                recLogItems1 = _db_RecLog.search_Fulltext(cmd1, tvProgramTitle1, RecLogItem.RecodeStatuses.ALL, DB_RecLog.searchColumns.title, 1, item1.epgEventInfoR.ContentInfo);
                                break;

                            case RecLogView.searchMethods.Freetext:
                                recLogItems1 = _db_RecLog.search_Fulltext(cmd1, tvProgramTitle1, RecLogItem.RecodeStatuses.ALL, DB_RecLog.searchColumns.title, 1, item1.epgEventInfoR.ContentInfo, true);
                                break;

                            default:
                                throw new NotSupportedException();
                            }
                            if (0 < recLogItems1.Count)
                            {
                                item1.recodeStatus = recLogItems1[0].recodeStatus;
                            }
                        }
                    }
                }
            }
            catch (Exception ex0)
            {
                errLog(ex0);
            }
        }
Ejemplo n.º 2
0
        string removeAndkeyFromNotWord(string word0)
        {
            if (string.IsNullOrWhiteSpace(epgSearchKeyInfoS.andKey))
            {
                return(word0);
            }
            //
            string word1 = word0;

            foreach (var item1 in Regex.Split(epgSearchKeyInfoS.andKey, "\\s+"))
            {
                word1 = Regex.Replace(word1, "\\b" + Regex.Escape(item1) + "\\b", " ");
            }
            word1 = RecLogWindow.trimKeyword(word1);

            return(word1);
        }