2018-06-24 15:14:46 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web;
|
2018-06-24 17:36:08 +02:00
|
|
|
|
using System.ServiceModel;
|
2018-06-24 15:14:46 +02:00
|
|
|
|
|
|
|
|
|
namespace EHEC_Server.DatabaseAccess
|
|
|
|
|
{
|
|
|
|
|
public class ResultAccess
|
|
|
|
|
{
|
2018-06-30 11:52:50 +02:00
|
|
|
|
public Result CreateResult(Result result)
|
2018-06-24 15:14:46 +02:00
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|
|
|
|
{
|
|
|
|
|
ctx.Result.Add(result);
|
|
|
|
|
ctx.SaveChanges();
|
|
|
|
|
}
|
2018-06-30 11:52:50 +02:00
|
|
|
|
return result;
|
2018-06-24 15:14:46 +02:00
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
2018-06-30 11:52:50 +02:00
|
|
|
|
return new Result();
|
2018-06-24 15:14:46 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-06-24 17:36:08 +02:00
|
|
|
|
public List<Result> GetAllResults()
|
|
|
|
|
{
|
|
|
|
|
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|
|
|
|
{
|
2018-06-30 11:52:50 +02:00
|
|
|
|
ctx.Configuration.ProxyCreationEnabled = false;
|
|
|
|
|
List<Result> list = new List<Result>();
|
2018-06-24 17:36:08 +02:00
|
|
|
|
return ctx.Result.ToList();
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-06-24 15:14:46 +02:00
|
|
|
|
}
|
|
|
|
|
}
|