Создал файлы логики, нужно реализовать

This commit is contained in:
Никита Потапов 2024-05-14 23:49:46 +04:00
parent 64470b20f3
commit d02b0337b2
14 changed files with 291 additions and 3 deletions

View File

@ -5,9 +5,11 @@ VisualStudioVersion = 17.9.34714.143
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MedicalView", "MedicalView\MedicalView.csproj", "{9CEA3FF8-036C-4844-9376-8B09E8507E7F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MedicalDatabaseContracts", "MedicalDatabaseContracts\MedicalDatabaseContracts.csproj", "{43A2B5DF-F305-412B-BE81-161E0B495AEB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MedicalDatabaseContracts", "MedicalDatabaseContracts\MedicalDatabaseContracts.csproj", "{43A2B5DF-F305-412B-BE81-161E0B495AEB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MedicalPostgresqlDatabase", "MedicalPostgresqlDatabase\MedicalPostgresqlDatabase.csproj", "{2BAF4C2E-DC1E-443B-85CC-4F44A8C98E17}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MedicalPostgresqlDatabase", "MedicalPostgresqlDatabase\MedicalPostgresqlDatabase.csproj", "{2BAF4C2E-DC1E-443B-85CC-4F44A8C98E17}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MedicalBusinessLogic", "MedicalBusinessLogic\MedicalBusinessLogic.csproj", "{91F8C37D-9865-42E2-A9AC-4A672259FD31}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -27,6 +29,10 @@ Global
{2BAF4C2E-DC1E-443B-85CC-4F44A8C98E17}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2BAF4C2E-DC1E-443B-85CC-4F44A8C98E17}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2BAF4C2E-DC1E-443B-85CC-4F44A8C98E17}.Release|Any CPU.Build.0 = Release|Any CPU
{91F8C37D-9865-42E2-A9AC-4A672259FD31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91F8C37D-9865-42E2-A9AC-4A672259FD31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91F8C37D-9865-42E2-A9AC-4A672259FD31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91F8C37D-9865-42E2-A9AC-4A672259FD31}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,45 @@
using MedicalDatabaseContracts;
using MedicalDatabaseContracts.Models;
using MedicalDatabaseContracts.SearchModels;
using MedicalDatabaseContracts.ViewModels;
using Microsoft.Extensions.Logging;
namespace MedicalBusinessLogic.BusinessLogics
{
public class DiagnoseLogic : ILogic<Diagnose, DiagnoseViewModel, DiagnoseSearchModel>
{
private readonly IStorage<Diagnose> _diagnoseStorage;
private readonly ILogger<DiagnoseLogic> _logger;
public DiagnoseLogic(IStorage<Diagnose> diagnoseStorage, ILogger<DiagnoseLogic> logger)
{
_diagnoseStorage = diagnoseStorage;
_logger = logger;
}
public bool Create(Diagnose model)
{
throw new NotImplementedException();
}
public bool Delete(Diagnose model)
{
throw new NotImplementedException();
}
public DiagnoseViewModel? ReadElement(DiagnoseSearchModel searchModel)
{
throw new NotImplementedException();
}
public List<DiagnoseViewModel>? ReadList(DiagnoseSearchModel? searchModel)
{
throw new NotImplementedException();
}
public bool Update(Diagnose model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,45 @@
using MedicalDatabaseContracts;
using MedicalDatabaseContracts.Models;
using MedicalDatabaseContracts.SearchModels;
using MedicalDatabaseContracts.ViewModels;
using Microsoft.Extensions.Logging;
namespace MedicalBusinessLogic.BusinessLogics
{
public class DoctorLogic : ILogic<Doctor, DoctorViewModel, DoctorSearchModel>
{
private readonly IStorage<Doctor> _doctorStorage;
private readonly ILogger<DoctorLogic> _logger;
public DoctorLogic(IStorage<Doctor> doctorStorage, ILogger<DoctorLogic> logger)
{
_doctorStorage = doctorStorage;
_logger = logger;
}
public bool Create(Doctor model)
{
throw new NotImplementedException();
}
public bool Delete(Doctor model)
{
throw new NotImplementedException();
}
public DoctorViewModel? ReadElement(DoctorSearchModel searchModel)
{
throw new NotImplementedException();
}
public List<DoctorViewModel>? ReadList(DoctorSearchModel? searchModel)
{
throw new NotImplementedException();
}
public bool Update(Doctor model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,45 @@
using MedicalDatabaseContracts;
using MedicalDatabaseContracts.Models;
using MedicalDatabaseContracts.SearchModels;
using MedicalDatabaseContracts.ViewModels;
using Microsoft.Extensions.Logging;
namespace MedicalBusinessLogic.BusinessLogics
{
public class PatientLogic : ILogic<Patient, PatientViewModel, PatientSearchModel>
{
private readonly IStorage<Patient> _patientStorage;
private readonly ILogger<PatientLogic> _logger;
public PatientLogic(IStorage<Patient> patientStorage, ILogger<PatientLogic> logger)
{
_patientStorage = patientStorage;
_logger = logger;
}
public bool Create(Patient model)
{
throw new NotImplementedException();
}
public bool Delete(Patient model)
{
throw new NotImplementedException();
}
public PatientViewModel? ReadElement(PatientSearchModel searchModel)
{
throw new NotImplementedException();
}
public List<PatientViewModel>? ReadList(PatientSearchModel? searchModel)
{
throw new NotImplementedException();
}
public bool Update(Patient model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,45 @@
using MedicalDatabaseContracts;
using MedicalDatabaseContracts.Models;
using MedicalDatabaseContracts.SearchModels;
using MedicalDatabaseContracts.ViewModels;
using Microsoft.Extensions.Logging;
namespace MedicalBusinessLogic.BusinessLogics
{
public class SpecializationLogic : ILogic<Specialization, SpecializationViewModel, SpecializationSearchModel>
{
private readonly IStorage<Specialization> _specializationStorage;
private readonly ILogger<SpecializationLogic> _logger;
public SpecializationLogic(IStorage<Specialization> specializationStorage, ILogger<SpecializationLogic> logger)
{
_specializationStorage = specializationStorage;
_logger = logger;
}
public bool Create(Specialization model)
{
throw new NotImplementedException();
}
public bool Delete(Specialization model)
{
throw new NotImplementedException();
}
public SpecializationViewModel? ReadElement(SpecializationSearchModel searchModel)
{
throw new NotImplementedException();
}
public List<SpecializationViewModel>? ReadList(SpecializationSearchModel? searchModel)
{
throw new NotImplementedException();
}
public bool Update(Specialization model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,45 @@
using MedicalDatabaseContracts;
using MedicalDatabaseContracts.Models;
using MedicalDatabaseContracts.SearchModels;
using MedicalDatabaseContracts.ViewModels;
using Microsoft.Extensions.Logging;
namespace MedicalBusinessLogic.BusinessLogics
{
public class VisitLogic : ILogic<Visit, VisitViewModel, VisitSearchModel>
{
private readonly IStorage<Visit> _visitStorage;
private readonly ILogger<VisitLogic> _logger;
public VisitLogic(IStorage<Visit> visitStorage, ILogger<VisitLogic> logger)
{
_visitStorage = visitStorage;
_logger = logger;
}
public bool Create(Visit model)
{
throw new NotImplementedException();
}
public bool Delete(Visit model)
{
throw new NotImplementedException();
}
public VisitViewModel? ReadElement(VisitSearchModel searchModel)
{
throw new NotImplementedException();
}
public List<VisitViewModel>? ReadList(VisitSearchModel? searchModel)
{
throw new NotImplementedException();
}
public bool Update(Visit model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\MedicalDatabaseContracts\MedicalDatabaseContracts.csproj" />
<ProjectReference Include="..\MedicalPostgresqlDatabase\MedicalPostgresqlDatabase.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,9 @@
namespace MedicalDatabaseContracts.SearchModels
{
public class AbstractPersonSearchModel : AbstractSearchModel
{
public string? Name { get; set; }
public string? Surname { get; set; }
public string? Patronymic { get; set; }
}
}

View File

@ -0,0 +1,4 @@
namespace MedicalDatabaseContracts.SearchModels
{
public class DiagnoseSearchModel : AbstractSearchModel { }
}

View File

@ -0,0 +1,7 @@
namespace MedicalDatabaseContracts.SearchModels
{
public class DoctorSearchModel : AbstractPersonSearchModel
{
public int? SpecializationId { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace MedicalDatabaseContracts.SearchModels
{
public class PatientSearchModel : AbstractPersonSearchModel
{
public char? Gender { get; set; }
}
}

View File

@ -0,0 +1,4 @@
namespace MedicalDatabaseContracts.SearchModels
{
public class SpecializationSearchModel : AbstractSearchModel { }
}

View File

@ -0,0 +1,12 @@
namespace MedicalDatabaseContracts.SearchModels
{
public class VisitSearchModel : AbstractSearchModel
{
public DateOnly? DateFrom { get; set; }
public DateOnly? DateTo { get; set; }
public DateOnly? Date { get; set; }
public TimeOnly? TimeFrom { get; set; }
public TimeOnly? TimeTo { get; set; }
public TimeOnly? Time { get; set; }
}
}

View File

@ -3,7 +3,7 @@ using System.ComponentModel;
namespace MedicalDatabaseContracts.ViewModels
{
public abstract class AbstractPersonViewModel : AbstractModel
public abstract class AbstractPersonViewModel : AbstractViewModel
{
[DisplayName("Имя")]
public string Name { get; set; } = string.Empty;