public static EProductTag StringToEProductTag(string val) { EProductTag _rVal = EProductTag.NULL; if (val == null || val.Trim() == "") { return(EProductTag.NULL); } val = val.ToUpper().Trim(); switch (val) { case "": case "NULL": _rVal = EProductTag.NULL; break; case "NEW": _rVal = EProductTag.NEW; break; case "HOT": _rVal = EProductTag.HOT; break; case "RECOMMEND": _rVal = EProductTag.RECOMMEND; break; case "BARGAINPRICE": _rVal = EProductTag.BARGAINPRICE; break; default: break; } return(_rVal); }
public static EProductTag IntToEProductTag(int val) { EProductTag _rVal = EProductTag.NULL; if (val == null) { return(EProductTag.NULL); } switch (val) { case -1: _rVal = EProductTag.NULL; break; case 1: _rVal = EProductTag.NEW; break; case 2: _rVal = EProductTag.HOT; break; case 3: _rVal = EProductTag.RECOMMEND; break; case 4: _rVal = EProductTag.BARGAINPRICE; break; default: break; } return(_rVal); }