Добавил интерфейсы и сделал для них заглушки
This commit is contained in:
parent
ee58b404cc
commit
2dd759cb4a
@ -22,8 +22,8 @@ public class Doctor
|
|||||||
return new Doctor
|
return new Doctor
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
First_Name = first_Name,
|
First_Name = first_Name ?? string.Empty,
|
||||||
Last_Name = last_Name,
|
Last_Name = last_Name ?? string.Empty,
|
||||||
DoctorPost = doctorPost
|
DoctorPost = doctorPost
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -14,12 +14,12 @@ public class Patient
|
|||||||
|
|
||||||
public string Last_Name { get; private set; } = string.Empty;
|
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
|
return new Patient
|
||||||
{
|
{
|
||||||
|
@ -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<IDoctorPaymentsRepository> ReadDoctorPayments();
|
||||||
|
|
||||||
|
DoctorPayments ReadDoctorPaymentsById(int id);
|
||||||
|
|
||||||
|
void CreateDoctorPayments(DoctorPayments doctorPayments);
|
||||||
|
|
||||||
|
void UpdateDoctorPayments(DoctorPayments doctorPayments);
|
||||||
|
|
||||||
|
void DeleteDoctorPayments(int id);
|
||||||
|
}
|
@ -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<Doctor> ReadDoctors();
|
||||||
|
|
||||||
|
Doctor ReadDoctorById(int id);
|
||||||
|
|
||||||
|
void CreateDoctor(Doctor doctor);
|
||||||
|
|
||||||
|
void UpdateDoctor(Doctor doctor);
|
||||||
|
|
||||||
|
void DeleteDoctor(int id);
|
||||||
|
}
|
@ -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<MedicalHistory> ReadMedicalHistory(DateTime? dateForm = null, DateTime? dateTo = null, int? PatientId = null,
|
||||||
|
int? DoctorId = null); // по этим параметрам можно не весь список читать, а только какую то часть
|
||||||
|
|
||||||
|
void CreateMedicalHistory(MedicalHistory medicalHistory); // объекь будет заносится в список
|
||||||
|
}
|
@ -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;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Операцию read (чтение) разобьем на 2 метода: получение коллекции и получений одной записи по идентификатору.
|
||||||
|
/// </summary>
|
||||||
|
public interface IPatientRepository
|
||||||
|
{
|
||||||
|
IEnumerable<Patient> ReadPatient(); // метод получения всего списка (в данном случае пациентов)
|
||||||
|
|
||||||
|
Patient ReadPatientById(int id); // получение по id
|
||||||
|
|
||||||
|
void CreatPatient(Patient patient); // метод для того чтобы добавить в существующую коллекцию пациента
|
||||||
|
|
||||||
|
void UpdatePatient(Patient patient); // метод на изменение
|
||||||
|
|
||||||
|
void DeletePatient(int id);
|
||||||
|
}
|
@ -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<IDoctorPaymentsRepository> ReadDoctorPayments()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public DoctorPayments ReadDoctorPaymentsById(int id)
|
||||||
|
{
|
||||||
|
return DoctorPayments.CreateElement(0, 0, string.Empty, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateDoctorPayments(DoctorPayments doctorPayments)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -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<Doctor> ReadDoctors()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateDoctor(Doctor doctor)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -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<MedicalHistory> ReadMedicalHistory(DateTime? dateForm = null, DateTime? dateTo = null, int? PatientId = null, int? DoctorId = null)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
@ -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<Patient> ReadPatient()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public Patient ReadPatientById(int id)
|
||||||
|
{
|
||||||
|
return Patient.CreatePatient(0, string.Empty, string.Empty, string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdatePatient(Patient patient)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user