2018-06-17 16:52:23 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
using System.ServiceModel;
|
|
|
|
|
using System.Text;
|
2018-06-22 16:29:27 +02:00
|
|
|
|
using EHEC_Server.DataBuilder;
|
2018-06-17 16:52:23 +02:00
|
|
|
|
|
2018-07-29 13:44:28 +02:00
|
|
|
|
|
2018-06-17 16:52:23 +02:00
|
|
|
|
namespace EHEC_Server
|
|
|
|
|
{
|
2018-07-17 19:51:33 +02:00
|
|
|
|
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the
|
|
|
|
|
// class name "Service" in code, svc and config file together.
|
|
|
|
|
// 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.
|
2018-06-17 16:52:23 +02:00
|
|
|
|
public class Service : IService
|
|
|
|
|
{
|
2018-06-24 15:14:46 +02:00
|
|
|
|
|
2018-06-30 11:52:50 +02:00
|
|
|
|
Doctor dataaccess_doctor = new Doctor();
|
2018-07-29 13:44:28 +02:00
|
|
|
|
private static List<Doctor> Doctors = new List<Doctor>();
|
2018-06-30 11:52:50 +02:00
|
|
|
|
Patient dataaccess_patient = new Patient();
|
|
|
|
|
Result dataaccess_result = new Result();
|
|
|
|
|
Origin dataaccess_origin = new Origin();
|
2018-07-11 08:06:33 +02:00
|
|
|
|
Origin_Exam dataaccess_origin_exam = new Origin_Exam();
|
2018-06-30 11:52:50 +02:00
|
|
|
|
Exam dataaccess_exam = new Exam();
|
2018-07-17 19:51:33 +02:00
|
|
|
|
|
2018-06-30 11:52:50 +02:00
|
|
|
|
|
2018-06-22 16:29:27 +02:00
|
|
|
|
public List<Doctor> GetDoctors()
|
2018-06-17 16:52:23 +02:00
|
|
|
|
{
|
2018-06-30 11:52:50 +02:00
|
|
|
|
return dataaccess_doctor.GetAllDoctors();
|
2018-06-17 19:42:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Patient> GetPatients()
|
|
|
|
|
{
|
2018-06-30 11:52:50 +02:00
|
|
|
|
return dataaccess_patient.GetAllPatients();
|
|
|
|
|
}
|
|
|
|
|
public List<Result> GetResults()
|
|
|
|
|
{
|
|
|
|
|
return dataaccess_result.GetAllResults();
|
2018-06-17 19:42:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
2018-06-30 11:52:50 +02:00
|
|
|
|
public Doctor WriteDoctor(Doctor doctor)
|
2018-06-17 19:42:15 +02:00
|
|
|
|
{
|
2018-06-30 11:52:50 +02:00
|
|
|
|
return dataaccess_doctor.CreateDoctor(doctor);
|
2018-06-17 19:42:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
2018-06-30 11:52:50 +02:00
|
|
|
|
public Patient WritePatient(Patient patient)
|
2018-06-17 19:42:15 +02:00
|
|
|
|
{
|
2018-06-30 11:52:50 +02:00
|
|
|
|
return dataaccess_patient.CreatePatient(patient);
|
2018-06-17 19:42:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
2018-06-30 11:52:50 +02:00
|
|
|
|
public Origin WriteOrigin(Origin origin)
|
2018-06-17 19:42:15 +02:00
|
|
|
|
{
|
2018-06-30 11:52:50 +02:00
|
|
|
|
return dataaccess_origin.CreateOrigin(origin);
|
2018-06-17 19:42:15 +02:00
|
|
|
|
}
|
2018-07-11 08:06:33 +02:00
|
|
|
|
public Origin_Exam WriteOrigin_Exam(Origin_Exam origin_exam)
|
|
|
|
|
{
|
|
|
|
|
return dataaccess_origin_exam.CreateOrigin_Exam(origin_exam);
|
|
|
|
|
}
|
2018-06-30 11:52:50 +02:00
|
|
|
|
public Exam WriteExam(Exam exam)
|
2018-06-17 19:42:15 +02:00
|
|
|
|
{
|
2018-06-30 11:52:50 +02:00
|
|
|
|
return dataaccess_exam.CreateExam(exam);
|
2018-06-17 19:42:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
2018-06-30 11:52:50 +02:00
|
|
|
|
public Result WriteResult(Result result)
|
2018-06-17 19:42:15 +02:00
|
|
|
|
{
|
2018-06-30 11:52:50 +02:00
|
|
|
|
return dataaccess_result.CreateResult(result);
|
2018-06-17 16:52:23 +02:00
|
|
|
|
}
|
2018-07-29 13:44:28 +02:00
|
|
|
|
public Doctor CreateRandomDoctor(Doctor doctors)
|
|
|
|
|
{
|
|
|
|
|
return GenerateDataBuilder.CreateRandomDoctors(doctors);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Patient CreateRandomPatient(Patient patients)
|
|
|
|
|
{
|
|
|
|
|
return GenerateDataBuilder.CreateRandomPatients(patients);
|
|
|
|
|
}
|
2018-07-14 10:54:24 +02:00
|
|
|
|
|
2018-07-17 19:51:33 +02:00
|
|
|
|
private readonly string ping = "pong";
|
2018-07-14 10:54:24 +02:00
|
|
|
|
public string Ping()
|
|
|
|
|
{
|
|
|
|
|
return ping;
|
|
|
|
|
}
|
2018-06-17 16:52:23 +02:00
|
|
|
|
}
|
|
|
|
|
}
|