枚举型转整型
int typeId = (int)Enum.ToObject(typeof(ConsumableType),consumable.Type);
整型转枚举型
ConsumableType type = (ConsumableType)Enum.ToObject(typeof(ConsumableType),typeId);
ConsumableType type = (ConsumableType)typeId;
获取所有枚举类型值
Enum.GetValues(typeof(ConsumableType));
字符型转枚举型
string testStatus = dtAssay.Rows[j]["TestStatus"].ToString();
RunningState state = (RunningState)Enum.Parse(typeof(RunningState), testStatus);