adding service functions

This commit is contained in:
ismail 2018-06-17 19:42:15 +02:00
parent c6eed0b6e8
commit aa6695c0aa
7 changed files with 91 additions and 4 deletions

View File

@ -19,7 +19,6 @@ namespace EHEC_Server
{
this.Exam = new HashSet<Exam>();
}
public int DoctorId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
@ -27,5 +26,15 @@ namespace EHEC_Server
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Exam> Exam { get; set; }
internal void CreateDoctor(Doctor doctor)
{
throw new NotImplementedException();
}
internal List<Doctor> GetAllDoctors()
{
throw new NotImplementedException();
}
}
}

View File

@ -26,5 +26,10 @@ namespace EHEC_Server
public virtual Origin Origin { get; set; }
public virtual Patient Patient { get; set; }
public virtual Result Result { get; set; }
internal void CreateExam(Exam exam)
{
throw new NotImplementedException();
}
}
}

View File

@ -12,6 +12,20 @@ namespace EHEC_Server
public interface IService
{
[OperationContract]
void DoWork();
void WriteDoctor(Doctor doctor);
[OperationContract]
void WritePatient(Patient patient);
[OperationContract]
void WriteOrigin(Origin origin);
[OperationContract]
void WriteExam(Exam exam);
[OperationContract]
void WriteResult(Result result);
}
}

View File

@ -28,5 +28,10 @@ namespace EHEC_Server
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Exam> Exam { get; set; }
internal void CreateOrigin(Origin origin)
{
throw new NotImplementedException();
}
}
}

View File

@ -19,7 +19,7 @@ namespace EHEC_Server
{
this.Exam = new HashSet<Exam>();
}
public int PatientId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
@ -29,5 +29,16 @@ namespace EHEC_Server
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Exam> Exam { get; set; }
internal void CreatePatient(Patient patient)
{
throw new NotImplementedException();
}
internal List<Patient> GetAllPatients()
{
throw new NotImplementedException();
}
}
}

View File

@ -26,5 +26,10 @@ namespace EHEC_Server
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Exam> Exam { get; set; }
internal void CreateResult(Result result)
{
throw new NotImplementedException();
}
}
}

View File

@ -11,8 +11,46 @@ namespace EHEC_Server
// NOTE: In order to launch WCF Test Client for testing this service, please select Service.svc or Service.svc.cs at the Solution Explorer and start debugging.
public class Service : IService
{
public void DoWork()
public List<Doctor> GetDoctors()
{
Doctor dataaccess = new Doctor();
return dataaccess.GetAllDoctors();
}
public List<Patient> GetPatients()
{
Patient dataaccess = new Patient();
return dataaccess.GetAllPatients();
}
public void WriteDoctor(Doctor doctor)
{
Doctor dataaccess = new Doctor();
dataaccess.CreateDoctor(doctor);
}
public void WritePatient(Patient patient)
{
Patient dataaccess = new Patient();
dataaccess.CreatePatient(patient);
}
public void WriteOrigin(Origin origin)
{
Origin dataaccess = new Origin();
dataaccess.CreateOrigin(origin);
}
public void WriteExam(Exam exam)
{
Exam dataaccess = new Exam();
dataaccess.CreateExam(exam);
}
public void WriteResult(Result result)
{
Result dataaccess = new Result();
dataaccess.CreateResult(result);
}
}
}