oop_II-6/EHEC_Server/EHEC_Server/Service.svc.cs

99 lines
2.9 KiB
C#
Raw Normal View History

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;
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.
public class Service : IService
{
Doctor dataaccess_doctor = new Doctor();
private static List<Doctor> Doctors = new List<Doctor>();
Patient dataaccess_patient = new Patient();
Result dataaccess_result = new Result();
Origin dataaccess_origin = new Origin();
Origin_Exam dataaccess_origin_exam = new Origin_Exam();
Exam dataaccess_exam = new Exam();
2018-07-17 19:51:33 +02:00
2018-06-22 16:29:27 +02:00
public List<Doctor> GetDoctors()
{
return dataaccess_doctor.GetAllDoctors();
2018-06-17 19:42:15 +02:00
}
public List<Patient> GetPatients()
{
return dataaccess_patient.GetAllPatients();
}
public List<Result> GetResults()
{
return dataaccess_result.GetAllResults();
2018-06-17 19:42:15 +02:00
}
public Doctor WriteDoctor(Doctor doctor)
2018-06-17 19:42:15 +02:00
{
return dataaccess_doctor.CreateDoctor(doctor);
2018-06-17 19:42:15 +02:00
}
public Patient WritePatient(Patient patient)
2018-06-17 19:42:15 +02:00
{
return dataaccess_patient.CreatePatient(patient);
2018-06-17 19:42:15 +02:00
}
public Origin WriteOrigin(Origin origin)
2018-06-17 19:42:15 +02:00
{
return dataaccess_origin.CreateOrigin(origin);
2018-06-17 19:42:15 +02:00
}
public Origin_Exam WriteOrigin_Exam(Origin_Exam origin_exam)
{
return dataaccess_origin_exam.CreateOrigin_Exam(origin_exam);
}
public Exam WriteExam(Exam exam)
2018-06-17 19:42:15 +02:00
{
return dataaccess_exam.CreateExam(exam);
2018-06-17 19:42:15 +02:00
}
public Result WriteResult(Result result)
2018-06-17 19:42:15 +02:00
{
return dataaccess_result.CreateResult(result);
}
public Doctor CreateRandomDoctor(Doctor doctors)
{
return GenerateDataBuilder.CreateRandomDoctors(doctors);
}
public Patient CreateRandomPatient(Patient patients)
{
return GenerateDataBuilder.CreateRandomPatients(patients);
}
public Origin CreateRandomOrigin(Origin origins)
{
return GenerateDataBuilder.CreateRandomOrigins(origins);
}
public Result CreateRandomResult(Result results)
{
return GenerateDataBuilder.CreateRandomResults(results);
}
public Exam CreateRandomExam(Exam exams)
{
return GenerateDataBuilder.CreateRandomExams(exams);
}
2018-07-17 19:51:33 +02:00
private readonly string ping = "pong";
public string Ping()
{
return ping;
}
}
}