public static EBadWordsType IntToEBadWordsType(int val) { EBadWordsType _rVal = EBadWordsType.REPLACE; if (val == null) { return(EBadWordsType.REPLACE); } switch (val) { case -1: _rVal = EBadWordsType.NULL; break; case 0: _rVal = EBadWordsType.REPLACE; break; case 1: _rVal = EBadWordsType.DISALLOW; break; default: break; } return(_rVal); }
public static EBadWordsType StringToEBadWordsType(string val) { EBadWordsType _rVal = EBadWordsType.REPLACE; if (val == null) { return(EBadWordsType.REPLACE); } val = val.ToUpper().Trim(); switch (val) { case "": case "NULL": _rVal = EBadWordsType.NULL; break; case "REPLACE": _rVal = EBadWordsType.REPLACE; break; case "AUDIT": _rVal = EBadWordsType.AUDIT; break; case "DISALLOW": _rVal = EBadWordsType.DISALLOW; break; default: break; } return(_rVal); }