2018-11-18 18:49:40 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using HospitalServerManager.InterfacesAndEnums;
|
2018-12-29 11:58:25 +01:00
|
|
|
|
using Newtonsoft.Json;
|
2018-11-18 18:49:40 +01:00
|
|
|
|
|
|
|
|
|
namespace HospitalServerManager.Model.Basic
|
|
|
|
|
{
|
|
|
|
|
class Doctor : SqlTable
|
|
|
|
|
{
|
|
|
|
|
public string Name { get; protected set; }
|
2018-12-22 15:52:17 +01:00
|
|
|
|
public AcademicDegrees _AcademicDegree { get; set; }
|
|
|
|
|
public MedicalSpecializations _MedicalSpecialization { get; set; }
|
2018-11-18 18:49:40 +01:00
|
|
|
|
public string Surname { get; protected set; }
|
|
|
|
|
public DateTime DateOfEmployment { get; protected set; }
|
2018-12-22 15:52:17 +01:00
|
|
|
|
public JobPositions _JobPosition { get; set; }
|
2018-11-18 18:49:40 +01:00
|
|
|
|
|
|
|
|
|
protected Doctor() : base()
|
|
|
|
|
{
|
|
|
|
|
}
|
2018-12-29 11:58:25 +01:00
|
|
|
|
public Doctor(int doctorID, string name, string surname, AcademicDegrees academicDegree,
|
|
|
|
|
MedicalSpecializations specialization, DateTime dateOfEmployment, JobPositions jobPosition)
|
|
|
|
|
: base(doctorID.ToString(), "Id_Lekarza", new List<string> { })
|
2018-11-18 18:49:40 +01:00
|
|
|
|
{
|
|
|
|
|
Name = name;
|
|
|
|
|
Surname = surname;
|
|
|
|
|
_AcademicDegree = academicDegree;
|
2018-12-29 11:58:25 +01:00
|
|
|
|
_MedicalSpecialization = specialization;
|
2018-11-18 18:49:40 +01:00
|
|
|
|
DateOfEmployment = dateOfEmployment;
|
|
|
|
|
_JobPosition = jobPosition;
|
|
|
|
|
}
|
2018-12-29 11:58:25 +01:00
|
|
|
|
[JsonConstructor]
|
|
|
|
|
protected Doctor(int doctorID, string name, string surname, string academicDegree,
|
|
|
|
|
string specialization, DateTime dateOfEmployment, string jobPosition)
|
|
|
|
|
: base(doctorID.ToString(), "Id_Lekarza", new List<string> { })
|
|
|
|
|
{
|
|
|
|
|
Name = name;
|
|
|
|
|
Surname = surname;
|
|
|
|
|
_AcademicDegree = academicDegree.GetEnumFromDescription<AcademicDegrees>();
|
|
|
|
|
_MedicalSpecialization = specialization.GetEnumFromDescription<MedicalSpecializations>();
|
|
|
|
|
DateOfEmployment = dateOfEmployment;
|
|
|
|
|
_JobPosition = jobPosition.GetEnumFromDescription<JobPositions>();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// List have to be in right order (doctor id, name, surname, academic degree, medical specialization,
|
|
|
|
|
/// date of employment, jobposition).
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="listOfValues"></param>
|
|
|
|
|
public Doctor(List<string> listOfValues) : base(listOfValues[0], "Id_Lekarza", new List<string> { })
|
2018-11-18 18:49:40 +01:00
|
|
|
|
{
|
|
|
|
|
Name = listOfValues[1];
|
|
|
|
|
Surname = listOfValues[2];
|
|
|
|
|
_AcademicDegree = listOfValues[3].GetEnumFromDescription<AcademicDegrees>();
|
|
|
|
|
_MedicalSpecialization = listOfValues[4].GetEnumFromDescription<MedicalSpecializations>();
|
|
|
|
|
DateOfEmployment = DateTime.Parse(listOfValues[5]);
|
|
|
|
|
_JobPosition = listOfValues[6].GetEnumFromDescription<JobPositions>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|