Добавил интерфейсы и сделал для них заглушки

This commit is contained in:
Bulat 2024-11-04 16:16:34 +03:00
parent ee58b404cc
commit 2dd759cb4a
10 changed files with 206 additions and 4 deletions

View File

@ -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
};
}

View File

@ -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
{

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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); // объекь будет заносится в список
}

View File

@ -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);
}

View File

@ -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)
{
}
}

View File

@ -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)
{
}
}

View File

@ -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 [];
}
}

View File

@ -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)
{
}
}