using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace PersonalLearning
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int ss= (int)OrderState.待支付;
Response.Write(ss);//这里输出得结果就是1了,表示待支付
string order= Enum.GetName(typeof(OrderState), 1);
Response.Write(order);//输出字符串‘待支付’;
}
#region 定义一个订单状态枚举
/// <summary>
/// 定义一个订单状态枚举
/// </summary>
public enum OrderState
{
待支付 = 1,
已付款 = 2,
待发货 = 3,
已发货=4,
待评价=5,
已评价=6,
订单关闭=7
}
#endregion
}
}