Beispiel #1
0
        public static ListItem GetListItem(EMatchType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
Beispiel #2
0
 public KeywordMatchInfo()
 {
     matchID             = 0;
     publishmentSystemID = 0;
     keyword             = string.Empty;
     keywordID           = 0;
     isDisabled          = false;
     keywordType         = EKeywordType.Text;
     matchType           = EMatchType.Exact;
 }
Beispiel #3
0
 public KeywordMatchInfo(int matchID, int publishmentSystemID, string keyword, int keywordID, bool isDisabled, EKeywordType keywordType, EMatchType matchType)
 {
     this.matchID             = matchID;
     this.publishmentSystemID = publishmentSystemID;
     this.keyword             = keyword;
     this.keywordID           = keywordID;
     this.isDisabled          = isDisabled;
     this.keywordType         = keywordType;
     this.matchType           = matchType;
 }
Beispiel #4
0
 public KeywordMatchInfo(int matchId, int publishmentSystemId, string keyword, int keywordId, bool isDisabled, EKeywordType keywordType, EMatchType matchType)
 {
     MatchId             = matchId;
     PublishmentSystemId = publishmentSystemId;
     Keyword             = keyword;
     KeywordId           = keywordId;
     IsDisabled          = isDisabled;
     KeywordType         = keywordType;
     MatchType           = matchType;
 }
Beispiel #5
0
 public static bool Equals(EMatchType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
Beispiel #6
0
 public KeywordInfo(int keywordID, int publishmentSystemID, string keywords, bool isDisabled, EKeywordType keywordType, EMatchType matchType, string reply, DateTime addDate, int taxis)
 {
     this.keywordID           = keywordID;
     this.publishmentSystemID = publishmentSystemID;
     this.keywords            = keywords;
     this.isDisabled          = isDisabled;
     this.keywordType         = keywordType;
     this.matchType           = matchType;
     this.reply   = reply;
     this.addDate = addDate;
     this.taxis   = taxis;
 }
Beispiel #7
0
 public KeywordInfo()
 {
     keywordID           = 0;
     publishmentSystemID = 0;
     keywords            = string.Empty;
     isDisabled          = false;
     keywordType         = EKeywordType.Text;
     matchType           = EMatchType.Exact;
     reply   = string.Empty;
     addDate = DateTime.Now;
     taxis   = 0;
 }
Beispiel #8
0
 public KeywordInfo(int keywordId, int publishmentSystemId, string keywords, bool isDisabled, EKeywordType keywordType, EMatchType matchType, string reply, DateTime addDate, int taxis)
 {
     KeywordId           = keywordId;
     PublishmentSystemId = publishmentSystemId;
     Keywords            = keywords;
     IsDisabled          = isDisabled;
     KeywordType         = keywordType;
     MatchType           = matchType;
     Reply   = reply;
     AddDate = addDate;
     Taxis   = taxis;
 }
Beispiel #9
0
 public static string GetText(EMatchType type)
 {
     if (type == EMatchType.Exact)
     {
         return("��ȷƥ��");
     }
     else if (type == EMatchType.Contains)
     {
         return("�����ؼ���");
     }
     else
     {
         throw new Exception();
     }
 }
Beispiel #10
0
 public static string GetValue(EMatchType type)
 {
     if (type == EMatchType.Exact)
     {
         return("Exact");
     }
     else if (type == EMatchType.Contains)
     {
         return("Contains");
     }
     else
     {
         throw new Exception();
     }
 }
Beispiel #11
0
        public static EMatchType GetEnumType(string typeStr)
        {
            EMatchType retval = EMatchType.Exact;

            if (Equals(EMatchType.Exact, typeStr))
            {
                retval = EMatchType.Exact;
            }
            else if (Equals(EMatchType.Contains, typeStr))
            {
                retval = EMatchType.Contains;
            }

            return(retval);
        }
Beispiel #12
0
 public static bool Equals(string typeStr, EMatchType type)
 {
     return(Equals(type, typeStr));
 }
Beispiel #13
0
        public void Update(int publishmentSystemID, int keywordID, EKeywordType keywordType, EMatchType matchType, string keywords)
        {
            var parms = new IDataParameter[]
            {
                GetParameter(PARM_KEYWORDS, EDataType.NVarChar, 255, keywords),
                GetParameter(PARM_KEYWORD_TYPE, EDataType.VarChar, 50, EKeywordTypeUtils.GetValue(keywordType)),
                GetParameter(PARM_KEYWORD_ID, EDataType.Integer, keywordID)
            };

            ExecuteNonQuery(SQL_UPDATE_KEYWRODS, parms);

            DataProviderWX.KeywordMatchDAO.DeleteByKeywordID(keywordID);

            foreach (var str in TranslateUtils.StringCollectionToStringList(keywords, ' '))
            {
                var keyword = str.Trim();
                if (!string.IsNullOrEmpty(keyword))
                {
                    DataProviderWX.KeywordMatchDAO.Insert(new KeywordMatchInfo(0, publishmentSystemID, keyword, keywordID, false, keywordType, matchType));
                }
            }
        }
Beispiel #14
0
        public void Update(int publishmentSystemId, int keywordId, EKeywordType keywordType, EMatchType matchType, string keywords)
        {
            var parms = new IDataParameter[]
            {
                GetParameter(ParmKeywords, EDataType.NVarChar, 255, keywords),
                GetParameter(ParmKeywordType, EDataType.VarChar, 50, EKeywordTypeUtils.GetValue(keywordType)),
                GetParameter(ParmKeywordId, EDataType.Integer, keywordId)
            };

            ExecuteNonQuery(SqlUpdateKeywrods, parms);

            DataProviderWx.KeywordMatchDao.DeleteByKeywordId(keywordId);

            foreach (var str in TranslateUtils.StringCollectionToStringList(keywords, ' '))
            {
                var keyword = str.Trim();
                if (!string.IsNullOrEmpty(keyword))
                {
                    DataProviderWx.KeywordMatchDao.Insert(new KeywordMatchInfo(0, publishmentSystemId, keyword, keywordId, false, keywordType, matchType));
                }
            }
        }