Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.31 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. use enum or dictionary?
  2. public enum Names {
  3.   Registrado = 0,
  4.   Activo = 1,
  5.   Finalizado = 2,
  6.   Anticipado = 3,
  7.   Reestructurado = 4
  8. }
  9.        
  10. int theDbValue = ...;
  11. Names name = (Names)theDbValue;
  12.        
  13. var map = new Dictionary<Names, string>();
  14. map[Names.Registrado] = "...";
  15. map[Names.Activo] = "...";
  16. // etc ...