枚举的应用
 GetEmu(CustomerKind.Normal);  
public enum CustomerKind
    {
      Normal = 90,
      Vip = 80,
      SuperVip = 70,
      InActive = 100
    }
//一种是用来判断
 public void GetEmu(CustomerKind c)
    {
        switch (c)
        { 
            case CustomerKind.Normal:
                Response.Write((int)CustomerKind.Normal);
                break;
            case CustomerKind.Vip:
                Response.Write((int)CustomerKind.Vip);
                break;
            default:
                Response.Write((int)CustomerKind.InActive);
                break;
        }
    }
//另一种是用来计算
  void bind()
    {
        if (Request.QueryString["id"] == null)
        {
           Response.Write(300/100 * (int)CustomerKind.Normal);
           Response.Write(CustomerKind.Normal);
        }
        else
        { 
            Response.Write(CustomerKind.Vip);
            Response.Write(300 / 100 * (int)CustomerKind.Vip);
        }
    }
  void bind()
    {
        if (Request.QueryString["id"] == null)
        {
           Response.Write(300/100 * (int)CustomerKind.Normal);
           Response.Write(CustomerKind.Normal);
        }
        else
        { 
            Response.Write(CustomerKind.Vip);
            Response.Write(300 / 100 * (int)CustomerKind.Vip);
        }
    }
 
                    
                     
                    
                 
                    
                
 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号