//public List<ODSVO> getODSD(int inods) //getODSD receive (id_ods) Return List of ODSVO public EntityVO getDetails(int inods) { FVSL_LINQDataContext dbcon = new FVSL_LINQDataContext(); //Create LINQ-SQL connection ODSVO result = new ODSVO(); try { List<ODS_ODS> resultset = dbcon.MAPA_ODS_DETAILS(inods).ToList(); if (resultset.Count == 1) { result = FODS(resultset[0]); } return (EntityVO)result; } catch (Exception e) { Logging.WriteError(e.StackTrace.ToString()); return null; } }
//FODS receive (ODS_ODS) Return ODSVO object (full) private ODSVO FODS(ODS_ODS odsin) { ODSVO aux = new ODSVO(); aux.id = odsin.id_ods.ToString(); aux.name = odsin.nombre; aux.latitude = odsin.Latitud; aux.longitude = odsin.Longitud; aux.direction = odsin.ciudad + ", " + odsin.urbanizacion + " " + odsin.calle; aux.website = odsin.pagina_web; aux.facebook = odsin.FacebookODS; aux.twitter = odsin.TwitterODS; aux.objective = odsin.objetivos; aux.email = odsin.email; aux.type = "ods"; aux.beneficiarios = getODSbeneficiario(odsin.id_ods); aux.awards = getODSaward(odsin.id_ods); aux.areas = getODSarea(odsin.id_ods); if (odsin.Logo != null) aux.imgdata = odsin.Logo.ToArray(); return aux; }