public EntityVO getDetails(int incoop) { FVSL_LINQDataContext dbcon = new FVSL_LINQDataContext(); //Create LINQ-SQL connection CooperantVO result = new CooperantVO(); try { List<tb_Coperante> resultset = dbcon.MAPA_COOP_DETAILS(incoop).ToList() ; if (resultset.Count == 1) //Start reading Resulset list, and adding to Result { result = FCOOP(resultset[0]); } return (EntityVO)result; } catch (Exception e) { Logging.WriteError(e.StackTrace.ToString()); return null; } }
private CooperantVO FCOOP(tb_Coperante coopin) { CooperantVO aux = new CooperantVO(); aux.id = coopin.id_coperante.ToString(); aux.name = coopin.nombre; aux.latitude = coopin.Latitud; aux.longitude = coopin.Longitud; aux.direction = coopin.ciudad + ", " + coopin.urbanizacion + " " + coopin.calle; aux.website = coopin.pagina_web; aux.facebook = coopin.Facebook; aux.twitter = coopin.Twitter; aux.objective = coopin.objetivos; aux.email = coopin.email; aux.type = NetworkVO.COOP_EXTRACTOR; aux.beneficiarios = getCOOPbeneficiario(coopin.id_coperante); aux.awards = getCOOPaward(coopin.id_coperante); aux.areas = getCOOParea(coopin.id_coperante); if (coopin.Logo != null) aux.imgdata = coopin.Logo.ToArray(); //if (coopin.Logo.ToArray().Equals(null)) aux.imgdata = coopin.Logo.ToArray(); aux.enfoque = coopin.EnfoqueGeografico.ToString(); aux.tipoOrganizacion = coopin.tipo_organizacion.ToString(); return aux; }