oop_II-6/EHEC_Server/EHEC_Server/cluster_dependencies/Models/ClusterResult.cs

38 lines
1.1 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;
namespace EHEC_Server
{
2018-07-21 17:16:56 +02:00
/// <summary>
/// This clas converts the object from db model to the needs of Json
/// conversion for Clusteranalysis.
/// </summary>
2018-07-17 19:51:33 +02:00
public class ClusterResult
{
public int Id { get; set; }
public string Name { get; set; }
2018-07-21 17:16:56 +02:00
public string Nodetype { get; set; }
2018-07-17 19:51:33 +02:00
public ClusterResult() { }
2018-07-21 17:16:56 +02:00
public List<ClusterResult> GetClusterResults()
2018-07-17 19:51:33 +02:00
{
2018-07-21 17:16:56 +02:00
Result result = new Result();
List<Result> results = new List<Result>();
results = result.GetAllResults();
List<ClusterResult> clusterResults = new List<ClusterResult>();
foreach (Result element in results)
{
ClusterResult clusterResult = new ClusterResult
{
Id = element.ResultId,
Nodetype = "result",
Name = element.Name
};
clusterResults.Add(clusterResult);
};
return clusterResults;
2018-07-17 19:51:33 +02:00
}
}
}