using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
namespace Client
{
public class Doctor
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Strasse { get; set; }
public int Plz { get; set; }
public string Ort { get; set; }
public string Region { get; set; }
public string DoctorOrigin { get; set; }
public Doctor() {}
///
/// this is my doctor construcor
///
/// first name of the doctor
/// last name of the doctor
/// region where the doctor works
/// Kantonal, Regional or Local Doctor
public Doctor(string firstName,
string lastName,
string strasse,
string plz,
string ort,
string region,
string doctype
)
{
FirstName = firstName;
LastName = lastName;
Strasse = strasse;
Plz = Convert.ToInt32(plz);
Ort = ort;
Region = region;
DoctorOrigin = doctype;
}
///
/// This writes the doctor back to the service into the db
///
public Doctor CreateDoctor()
{
// write doctor to wcf interface
EHEC_Service.Doctor mydoctor = new EHEC_Service.Doctor
{
FirstName = FirstName,
LastName = LastName,
Region = Region,
DoctorOrigin = DoctorOrigin
};
Id = Global.GlobalInstance.Service.WriteDoctor(mydoctor).DoctorId;
return Mapper.Map(mydoctor);
}
}
}