枚举
public class OrderStatusEnumToString
{
#region 订单类型
/// <summary>
/// 订单类型
/// </summary>
/// <returns></returns>
public static string OrderStatusToString(OrderStatusEnum enums)
{
string result = string.Empty;
switch (enums)
{
case OrderStatusEnum.Processing:
result = "待支付";
break;
case OrderStatusEnum.AlreadyAccount:
result = "已支付,未完成";
break;
case OrderStatusEnum.WaitGoods:
result = "出货中";
break;
case OrderStatusEnum.Success:
result = "已完成";
break;
case OrderStatusEnum.Refund:
result = "已退款";
break;
case OrderStatusEnum.Cancel:
result = "已取消";
break;
case OrderStatusEnum.ApplyforRefund:
result = "申请退款";
break;
default:
result = "";
break;
}
return result;
}
#endregion
}
#region 订单状态
/// <summary>
/// 订单状态
/// 订单状态 1已提交 2已支付 3已完成(出米) 4已退款 -1已取消
/// </summary>
public enum OrderStatusEnum
{
[Description("待支付")]
Processing = 1,
[Description("已支付,未完成")]
AlreadyAccount = 2,
[Description("已完成")]
Success = 3,
[Description("已退款")]
Refund=4,
[Description("出货中")]
WaitGoods=5,
[Description("申请退款")]
ApplyforRefund = 6,
[Description("已取消")]
Cancel=-1,
}
#endregion
调用 string OrderStateName = CommonModel.OrderStatusEnumToString.OrderStatusToString((CommonModel.OrderStatusEnum)item.OrderState);