//Constructores //Metodos Especiales public static JArray ObtenerJsonNivelInteresOportunidad(CConexion Conexion) { CNivelInteresOportunidad NivelInteresOportunidad = new CNivelInteresOportunidad(); JArray JNivelesInteresOportunidad = new JArray(); foreach (CNivelInteresOportunidad oNivelInteresOportunidad in NivelInteresOportunidad.LlenaObjetos(Conexion)) { JObject JNivelInteresOportunidad = new JObject(); JNivelInteresOportunidad.Add("Valor", oNivelInteresOportunidad.IdNivelInteresOportunidad); JNivelInteresOportunidad.Add("Descripcion", oNivelInteresOportunidad.NivelInteresOportunidad); JNivelInteresOportunidad.Add("Selected", 0); JNivelesInteresOportunidad.Add(JNivelInteresOportunidad); } return(JNivelesInteresOportunidad); }
//Metodos Especiales public static JArray ObtenerOportunidadUsuario(int pIdUsuario, CConexion Conexion) { JArray JOportunidades = new JArray(); COportunidad Oportunidad = new COportunidad(); Dictionary <string, object> Parametros = new Dictionary <string, object>(); Parametros.Add("Baja", 0); Parametros.Add("IdUsuarioCreacion", pIdUsuario); foreach (COportunidad oOportunidad in Oportunidad.LlenaObjetosFiltros(Parametros, Conexion)) { JObject JOportunidad = new JObject(); CNivelInteresOportunidad NivelInteresOportunidad = new CNivelInteresOportunidad(); NivelInteresOportunidad.LlenaObjeto(oOportunidad.IdNivelInteresOportunidad, Conexion); JOportunidad.Add("Valor", oOportunidad.IdOportunidad); JOportunidad.Add("Descripcion", oOportunidad.Oportunidad + " (" + NivelInteresOportunidad.NivelInteresOportunidad + ")"); JOportunidades.Add(JOportunidad); } return(JOportunidades); }