首页 > 代码库 > 数字转换枚举

数字转换枚举

var status = new Enums.AffairsOperatingResult();
int typeNum = 0;
int.TryParse(statusStr, out typeNum);
try
{

status = (Enums.AffairsOperatingResult)Enum.Parse(typeof(Enums.AffairsOperatingResult),
typeof(Enums.AffairsOperatingResult).GetEnumName(typeNum));

}
catch (Exception)
{
}