diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Doctor.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Doctor.cs index 52411f0..35283da 100644 --- a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Doctor.cs +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Doctor.cs @@ -22,8 +22,8 @@ public class Doctor return new Doctor { Id = id, - First_Name = first_Name, - Last_Name = last_Name, + First_Name = first_Name ?? string.Empty, + Last_Name = last_Name ?? string.Empty, DoctorPost = doctorPost }; } diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Patient.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Patient.cs index 32bf9b3..fe03a4b 100644 --- a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Patient.cs +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Entities/Patient.cs @@ -14,12 +14,12 @@ public class Patient public string Last_Name { get; private set; } = string.Empty; - public int ContactNumber { get; private set; } + public string ContactNumber { get; private set; } // ТУТ СДЕЛАЕМ СТАТИСТИЧЕСКИЙ МЕТОД - public static Patient CreatePatient(int id, string firts_Name, string last_Name, int contactNumber) + public static Patient CreatePatient(int id, string firts_Name, string last_Name, string contactNumber) { return new Patient { diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/IDoctorPaymentsRepository.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/IDoctorPaymentsRepository.cs new file mode 100644 index 0000000..63515e3 --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/IDoctorPaymentsRepository.cs @@ -0,0 +1,21 @@ +using RegistrationPatientsPolyclinic.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Repositories; + +public interface IDoctorPaymentsRepository +{ + IEnumerable ReadDoctorPayments(); + + DoctorPayments ReadDoctorPaymentsById(int id); + + void CreateDoctorPayments(DoctorPayments doctorPayments); + + void UpdateDoctorPayments(DoctorPayments doctorPayments); + + void DeleteDoctorPayments(int id); +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/IDoctorRepository.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/IDoctorRepository.cs new file mode 100644 index 0000000..6f84fda --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/IDoctorRepository.cs @@ -0,0 +1,21 @@ +using RegistrationPatientsPolyclinic.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Repositories; + +public interface IDoctorRepository +{ + IEnumerable ReadDoctors(); + + Doctor ReadDoctorById(int id); + + void CreateDoctor(Doctor doctor); + + void UpdateDoctor(Doctor doctor); + + void DeleteDoctor(int id); +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/IMedicalHistoryRepository.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/IMedicalHistoryRepository.cs new file mode 100644 index 0000000..7056b85 --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/IMedicalHistoryRepository.cs @@ -0,0 +1,16 @@ +using RegistrationPatientsPolyclinic.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Repositories; + +public interface IMedicalHistoryRepository +{ + IEnumerable ReadMedicalHistory(DateTime? dateForm = null, DateTime? dateTo = null, int? PatientId = null, + int? DoctorId = null); // по этим параметрам можно не весь список читать, а только какую то часть + + void CreateMedicalHistory(MedicalHistory medicalHistory); // объекь будет заносится в список +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/IPatientRepository.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/IPatientRepository.cs new file mode 100644 index 0000000..3cc9133 --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/IPatientRepository.cs @@ -0,0 +1,24 @@ +using RegistrationPatientsPolyclinic.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Repositories; + +/// +/// Операцию read (чтение) разобьем на 2 метода: получение коллекции и получений одной записи по идентификатору. +/// +public interface IPatientRepository +{ + IEnumerable ReadPatient(); // метод получения всего списка (в данном случае пациентов) + + Patient ReadPatientById(int id); // получение по id + + void CreatPatient(Patient patient); // метод для того чтобы добавить в существующую коллекцию пациента + + void UpdatePatient(Patient patient); // метод на изменение + + void DeletePatient(int id); +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/Implementations/DoctorPaymentsRepository.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/Implementations/DoctorPaymentsRepository.cs new file mode 100644 index 0000000..c70b5be --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/Implementations/DoctorPaymentsRepository.cs @@ -0,0 +1,33 @@ +using RegistrationPatientsPolyclinic.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Repositories.Implementations; + +public class DoctorPaymentsRepository : IDoctorPaymentsRepository +{ + public void CreateDoctorPayments(DoctorPayments doctorPayments) + { + } + + public void DeleteDoctorPayments(int id) + { + } + + public IEnumerable ReadDoctorPayments() + { + return []; + } + + public DoctorPayments ReadDoctorPaymentsById(int id) + { + return DoctorPayments.CreateElement(0, 0, string.Empty, 0, 0); + } + + public void UpdateDoctorPayments(DoctorPayments doctorPayments) + { + } +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/Implementations/DoctorRepository.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/Implementations/DoctorRepository.cs new file mode 100644 index 0000000..488d638 --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/Implementations/DoctorRepository.cs @@ -0,0 +1,34 @@ +using RegistrationPatientsPolyclinic.Entities; +using RegistrationPatientsPolyclinic.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Repositories.Implementations; + +public class DoctorRepository : IDoctorRepository +{ + public void CreateDoctor(Doctor doctor) + { + } + + public void DeleteDoctor(int id) + { + } + + public Doctor ReadDoctorById(int id) + { + return Doctor.CreateEntity(0, string.Empty, string.Empty, DoctorPost.None); + } + + public IEnumerable ReadDoctors() + { + return []; + } + + public void UpdateDoctor(Doctor doctor) + { + } +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/Implementations/MedicalHistoryRepository.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/Implementations/MedicalHistoryRepository.cs new file mode 100644 index 0000000..bbe5896 --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/Implementations/MedicalHistoryRepository.cs @@ -0,0 +1,20 @@ +using RegistrationPatientsPolyclinic.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Repositories.Implementations; + +public class MedicalHistoryRepository : IMedicalHistoryRepository +{ + public void CreateMedicalHistory(MedicalHistory medicalHistory) + { + } + + public IEnumerable ReadMedicalHistory(DateTime? dateForm = null, DateTime? dateTo = null, int? PatientId = null, int? DoctorId = null) + { + return []; + } +} diff --git a/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/Implementations/PatientRepository.cs b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/Implementations/PatientRepository.cs new file mode 100644 index 0000000..e1c3e33 --- /dev/null +++ b/RegistrationPatientsPolyclinic/RegistrationPatientsPolyclinic/Repositories/Implementations/PatientRepository.cs @@ -0,0 +1,33 @@ +using RegistrationPatientsPolyclinic.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RegistrationPatientsPolyclinic.Repositories.Implementations; + +public class PatientRepository : IPatientRepository +{ + public void CreatPatient(Patient patient) + { + } + + public void DeletePatient(int id) + { + } + + public IEnumerable ReadPatient() + { + return []; + } + + public Patient ReadPatientById(int id) + { + return Patient.CreatePatient(0, string.Empty, string.Empty, string.Empty); + } + + public void UpdatePatient(Patient patient) + { + } +}