oop_II-6/EHEC_Server/EHEC_Server/cluster_dependencies/ClusterConverter.cs

46 lines
1.4 KiB
C#
Raw Normal View History

2018-07-17 19:51:33 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using EHEC_Server;
2018-07-21 17:16:56 +02:00
using System.Web.Script.Serialization;
2018-07-17 19:51:33 +02:00
namespace EHEC_Server
{
public class ClusterConverter
{
2018-07-23 14:46:41 +02:00
protected string Json { get; set; }
2018-07-21 17:16:56 +02:00
public string WriteJson()
2018-07-17 19:51:33 +02:00
{
2018-07-23 14:46:41 +02:00
var Json = JsonConverter.Serialize(GetCluster());
//ClusterPatient p = new ClusterPatient();
//List<ClusterPatient> clusterPatientsList = new List<ClusterPatient>();
//clusterPatientsList = p.GetClusterPatients();
//ClusterResult r = new ClusterResult();
//List<ClusterResult> clusterResultsList = new List<ClusterResult>();
//clusterResultsList = r.GetClusterResults();
System.IO.File.WriteAllText(@"C: \Users\novski\Desktop\cluster.json", Json);
return Json; //= JsonConverter.Serialize(clusterPatientsList);
2018-07-17 19:51:33 +02:00
}
2018-07-23 14:46:41 +02:00
private Cluster GetCluster()
2018-07-17 19:51:33 +02:00
{
2018-07-23 14:46:41 +02:00
return new Cluster
{
Comment = "some comment",
Nodes = new List<Node>
{
new Node
{
Node get = new Node();
List <Node> xs = new List<Node>();
}
Nodes.add(getClusterPatients()) // irrgend sowas...
}
};
2018-07-17 19:51:33 +02:00
}
}
}