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-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-08-14 22:13:10 +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-08-19 21:55:46 +02:00
|
|
|
|
City dataaccess_city = new City();
|
2018-08-14 22:13:10 +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-08-19 21:55:46 +02:00
|
|
|
|
public List<City> GetCities()
|
|
|
|
|
{
|
|
|
|
|
return dataaccess_city.GetAllCities();
|
|
|
|
|
}
|
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
|
|
|
|
|
2018-08-19 21:55:46 +02:00
|
|
|
|
public City WriteCity(City city)
|
|
|
|
|
{
|
|
|
|
|
return dataaccess_city.CreateCity(city);
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-14 22:13:10 +02:00
|
|
|
|
public bool CreateRandomData(int valueToCreate)
|
2018-08-01 13:46:05 +02:00
|
|
|
|
{
|
2018-08-14 22:13:10 +02:00
|
|
|
|
return GenerateDataBuilder.CreateRandomData(valueToCreate);
|
2018-08-01 13:46:05 +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-08-22 22:15:21 +02:00
|
|
|
|
|
|
|
|
|
public void ReloadCluster()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2018-06-17 16:52:23 +02:00
|
|
|
|
}
|
|
|
|
|
}
|