public static ListItem GetListItem(EMatchType type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
public KeywordMatchInfo() { matchID = 0; publishmentSystemID = 0; keyword = string.Empty; keywordID = 0; isDisabled = false; keywordType = EKeywordType.Text; matchType = EMatchType.Exact; }
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; }
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; }
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); }
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; }
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; }
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; }
public static string GetText(EMatchType type) { if (type == EMatchType.Exact) { return("��ȷƥ��"); } else if (type == EMatchType.Contains) { return("�����ؼ���"); } else { throw new Exception(); } }
public static string GetValue(EMatchType type) { if (type == EMatchType.Exact) { return("Exact"); } else if (type == EMatchType.Contains) { return("Contains"); } else { throw new Exception(); } }
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); }
public static bool Equals(string typeStr, EMatchType type) { return(Equals(type, typeStr)); }
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)); } } }
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)); } } }