using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using EHEC_Server.DataBuilder;

namespace EHEC_Server
{
    // 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();
        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();
        private readonly string ping = "pong";

        public List<Doctor> GetDoctors()
        {
            return dataaccess_doctor.GetAllDoctors();
        }

        public List<Patient> GetPatients()
        {
            return dataaccess_patient.GetAllPatients();
        }
        public List<Result> GetResults()
        {
            return dataaccess_result.GetAllResults();
        }

        public Doctor WriteDoctor(Doctor doctor)
        {
            return dataaccess_doctor.CreateDoctor(doctor);
        }

        public Patient WritePatient(Patient patient)
        {
            return dataaccess_patient.CreatePatient(patient);
        }

        public Origin WriteOrigin(Origin origin)
        {
            return dataaccess_origin.CreateOrigin(origin);
        }
        public Origin_Exam WriteOrigin_Exam(Origin_Exam origin_exam)
        {
            return dataaccess_origin_exam.CreateOrigin_Exam(origin_exam);
        }
        public Exam WriteExam(Exam exam)
        {
            return dataaccess_exam.CreateExam(exam);
        }

        public Result WriteResult(Result result)
        {
            return dataaccess_result.CreateResult(result);
        }

        public string Ping()
        {
            return ping;
        }
    }
}
