Last active
May 2, 2017 21:52
-
-
Save mario-loza/6bdcb00aa9c7fc8741e2bdd5d7f022a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Ejemplo A | |
public enum TipoUsuario | |
{ | |
Admin, | |
User | |
} | |
//Para verificar un seting | |
if (tipoUsuario == TipoUsuario.Admin) | |
{ | |
EsAdmin = true; | |
} | |
//Ejemplo B | |
public enum Operacion | |
{ | |
ExtensionCredito, | |
Pago, | |
VentaActivos | |
} | |
//O para definir un proceso dentro de una funcion | |
if (proceso == Enum.GetName(typeof(Operacion), Operacion.ExtensionCredito)) | |
{ | |
calcularInteres = true; | |
} | |
//Eso se podria llamar asi... | |
this.EjecutarCalculoX(Enum.GetName(typeof(Operacion), Operacion.ExtensionCredito), clienteId: 567) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment