using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace EHEC_Server { public class Edge { public int Source { get; set; } public int Target { get; set; } public string Edgetype { get; set; } public Edge() { } public List GetEdges() { List X = new List(); X.AddRange(GetClusterRelationsPatientsOrigins()); X.AddRange(GetClusterRelationsPatientsResults()); return X; } public List GetClusterRelationsPatientsOrigins() { Exam exam = new Exam(); List exams = new List(); exams = exam.GetAllExams(); List clusterEdges = new List(); foreach (Exam element in exams) { Edge clusterEdge = new Edge { Edgetype = "Angesteckt in ", Source = element.PatientId, Target = element.DoctorId ///for tests !!!!!!!!!!!!!!!! correct it to Origin id somehow!!!!!!!! }; clusterEdges.Add(clusterEdge); } return clusterEdges; } public List GetClusterRelationsPatientsResults() { Exam exam = new Exam(); List exams = new List(); exams = exam.GetAllExams(); List clusterEdges = new List(); foreach (Exam element in exams) { Edge clusterEdge = new Edge { Edgetype = "Wurde Angesteckt mit ", Source = element.PatientId, Target = element.ResultId }; clusterEdges.Add(clusterEdge); }; return clusterEdges; } //public List GetClusterRelationOrigin() //{ // Origin origin = new Origin(); // List origins = new List(); // origins = origin.GetAllOrigins(); // List clusterOrigins = new List(); // foreach (Origin element in origins) // { // Nodes clusterOrigin = new Nodes // { // Nodetype = "Angesteckt in ", // Source = element.OriginId, // Target = element.City // }; // clusterOrigins.Add(clusterOrigin); // }; // return clusterOrigins; //} } }