public List<NetworkVO> getN() { FVSL_LINQDataContext dbcon = new FVSL_LINQDataContext(); List<NetworkVO> lista = new List<NetworkVO>(); try { List<mapa_get_network_odsResult> resultset = dbcon.mapa_get_network_ods().ToList(); foreach (mapa_get_network_odsResult net in resultset) { NetworkVO netw = new NetworkVO(); EntityVO ent = new EntityVO(); ent.id = net.id_ods.ToString(); ent.name = net.nombre; ent.latitude = net.Latitud.ToString(); ent.longitude = net.Longitud.ToString(); ent.type = NetworkVO.ODS_EXTRACTOR; netw.parent = ent; netw.type = NetworkVO.ODS_EXTRACTOR; lista.Add(netw); } return lista; } catch (Exception e) { Logging.WriteError(e.StackTrace.ToString()); return null; } }
public List<NetworkVO> getN() { FVSL_LINQDataContext dbcon = new FVSL_LINQDataContext(); List<NetworkVO> lista = new List<NetworkVO>(); try { //EMPRESAS// List<mapa_get_network_compResult> resultset = dbcon.mapa_get_network_comp().ToList(); foreach (mapa_get_network_compResult net in resultset) { NetworkVO netw = new NetworkVO(); EntityVO ent = new EntityVO(); ent.id = net.Id.ToString(); ent.name = net.Nombre; ent.latitude = net.Latitud.ToString(); ent.longitude = net.Longitud.ToString(); netw.parent = ent; netw.type = NetworkVO.EMP_EXTRACTOR; lista.Add(netw); } //ODS// List<mapa_get_network_odsResult> resultset1 = dbcon.mapa_get_network_ods().ToList(); foreach (mapa_get_network_odsResult net1 in resultset1) { NetworkVO netw1 = new NetworkVO(); EntityVO ent1 = new EntityVO(); ent1.id = net1.id_ods.ToString(); ent1.name = net1.nombre; ent1.latitude = net1.Latitud.ToString(); ent1.longitude = net1.Longitud.ToString(); netw1.parent = ent1; netw1.type = NetworkVO.ODS_EXTRACTOR; lista.Add(netw1); } //COOPERANTES// List<mapa_get_network_coopResult> resultset2 = dbcon.mapa_get_network_coop().ToList(); foreach (mapa_get_network_coopResult net2 in resultset2) { NetworkVO netw2 = new NetworkVO(); EntityVO ent2 = new EntityVO(); ent2.id = net2.id_coperante.ToString(); ent2.name = net2.nombre; ent2.latitude = net2.Latitud.ToString(); ent2.longitude = net2.Longitud.ToString(); netw2.parent = ent2; netw2.type = NetworkVO.COOP_EXTRACTOR; lista.Add(netw2); } return lista; } catch (Exception e) { Logging.WriteError(e.StackTrace.ToString()); return null; } }