public static IEnumerable <ParametroCondicion> ObtenerParametros(int?idCondicion) { var resultado = MotorCondicionDAO.ObtenerParametros(idCondicion); foreach (var item in resultado) { yield return(new ParametroCondicion { nombreParametro = TypeHelper.ConvertObjectToString(item["NOM_PARAMETRO"]), valorParametro = TypeHelper.ConvertObjectToString(item["VAL_PARAMETRO"]) }); } }
public static IEnumerable <Condicion> ObtenerCondiciones(int aplicacionTipo, int coberturaTipo, int linProId, int?llaId = null, int?ofeId = null) { var resultado = MotorCondicionDAO.ObtenerCondiciones(linProId, llaId, aplicacionTipo, coberturaTipo); foreach (var item in resultado) { List <ParametroCondicion> parametros = new List <ParametroCondicion>(); if ((int)TypeHelper.ConvertToIntNullable(item["NUM_PARAMETRO"]) > 0) { parametros = ObtenerParametros(TypeHelper.ConvertToIntNullable(item["ID_CONDICION"])).ToList(); } yield return(new Condicion { idCondicion = (int)TypeHelper.ConvertToIntNullable(item["ID_CONDICION"]), nombreCondicion = TypeHelper.ConvertObjectToString(item["NOM_CONDICION"]), numParametro = (int)TypeHelper.ConvertToIntNullable(item["NUM_PARAMETRO"]), tipoError = (int)TypeHelper.ConvertToIntNullable(item["ID_ERROR"]), listaParametros = parametros }); } }