35 lines
814 B
C#
35 lines
814 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Web;
|
|||
|
using System.ServiceModel;
|
|||
|
|
|||
|
namespace EHEC_Server.DatabaseAccess
|
|||
|
{
|
|||
|
public class DoctorAccess
|
|||
|
{
|
|||
|
public bool CreateDoctor(Doctor doctor)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|||
|
{
|
|||
|
ctx.Doctor.Add(doctor);
|
|||
|
ctx.SaveChanges();
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
catch (Exception)
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
public List<Doctor> GetAllDoctors()
|
|||
|
{
|
|||
|
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|||
|
{
|
|||
|
return ctx.Doctor.ToList();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|