2018-06-22 16:29:27 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using System.ServiceModel;
|
|
|
|
|
|
2018-06-24 17:36:08 +02:00
|
|
|
|
|
2018-07-11 08:06:33 +02:00
|
|
|
|
namespace EHEC_Server
|
2018-06-22 16:29:27 +02:00
|
|
|
|
{
|
2018-07-11 08:06:33 +02:00
|
|
|
|
public partial class Doctor
|
2018-06-22 16:29:27 +02:00
|
|
|
|
{
|
2018-06-30 11:52:50 +02:00
|
|
|
|
public Doctor CreateDoctor(Doctor doctor)
|
2018-06-22 16:29:27 +02:00
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|
|
|
|
{
|
2018-07-24 23:39:21 +02:00
|
|
|
|
doctor.DoctorUid = Guid.NewGuid().ToString();
|
2018-07-10 22:33:56 +02:00
|
|
|
|
ctx.Doctors.Add(doctor);
|
2018-06-22 16:29:27 +02:00
|
|
|
|
ctx.SaveChanges();
|
|
|
|
|
}
|
2018-06-30 11:52:50 +02:00
|
|
|
|
return doctor;
|
2018-06-22 16:29:27 +02:00
|
|
|
|
}
|
2018-08-19 17:34:30 +02:00
|
|
|
|
catch (Exception e)
|
2018-06-22 16:29:27 +02:00
|
|
|
|
{
|
2018-08-19 17:34:30 +02:00
|
|
|
|
System.Diagnostics.Trace.WriteLine(" --e-- Error in ServerCreateDoctor: " + e);
|
2018-06-30 11:52:50 +02:00
|
|
|
|
return new Doctor();
|
2018-06-22 16:29:27 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public List<Doctor> GetAllDoctors()
|
|
|
|
|
{
|
|
|
|
|
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
|
|
|
|
{
|
2018-07-10 22:33:56 +02:00
|
|
|
|
return ctx.Doctors.ToList();
|
2018-06-22 16:29:27 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|