37 lines
945 B
C#
37 lines
945 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.ServiceModel;
|
|
|
|
namespace EHEC_Server.DatabaseAccess
|
|
{
|
|
public class ResultAccess
|
|
{
|
|
public Result CreateResult(Result result)
|
|
{
|
|
try
|
|
{
|
|
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|
{
|
|
ctx.Result.Add(result);
|
|
ctx.SaveChanges();
|
|
}
|
|
return result;
|
|
}
|
|
catch (Exception)
|
|
{
|
|
return new Result();
|
|
}
|
|
}
|
|
public List<Result> GetAllResults()
|
|
{
|
|
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|
{
|
|
ctx.Configuration.ProxyCreationEnabled = false;
|
|
List<Result> list = new List<Result>();
|
|
return ctx.Result.ToList();
|
|
}
|
|
}
|
|
}
|
|
} |