35 lines
797 B
C#
35 lines
797 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Web;
|
|||
|
|
|||
|
namespace EHEC_Server.DatabaseAccess
|
|||
|
{
|
|||
|
public class PatientAccess
|
|||
|
{
|
|||
|
public bool CreatePatient(Patient patient)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|||
|
{
|
|||
|
ctx.Patient.Add(patient);
|
|||
|
ctx.SaveChanges();
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
catch (Exception)
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public List<Patient> GetAllPatients()
|
|||
|
{
|
|||
|
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|||
|
{
|
|||
|
return ctx.Patient.ToList();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|