Переделал все формы на логику
This commit is contained in:
parent
c11711a5f3
commit
379e7f4cdb
@ -1,12 +1,16 @@
|
||||
using MedicalDatabaseContracts;
|
||||
using MedicalDatabaseContracts.Models;
|
||||
using MedicalDatabaseContracts.SearchModels;
|
||||
using MedicalDatabaseContracts.ViewModels;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MedicalView.Diagnoses
|
||||
{
|
||||
public class FormDiagnoses : FormAbstractList<Diagnose>
|
||||
public class FormDiagnoses : FormAbstractList<Diagnose, DiagnoseViewModel, DiagnoseSearchModel>
|
||||
{
|
||||
public FormDiagnoses(ILogger<FormAbstractList<Diagnose>> logger, IStorage<Diagnose> storage) : base(logger, storage)
|
||||
public FormDiagnoses(
|
||||
ILogger<FormDiagnoses> logger,
|
||||
ILogic<Diagnose, DiagnoseViewModel, DiagnoseSearchModel> logic) : base(logger, logic)
|
||||
{
|
||||
Text = "Список диагнозов";
|
||||
}
|
||||
|
@ -1,12 +1,16 @@
|
||||
using MedicalDatabaseContracts;
|
||||
using MedicalDatabaseContracts.Models;
|
||||
using MedicalDatabaseContracts.SearchModels;
|
||||
using MedicalDatabaseContracts.ViewModels;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MedicalView.Doctors
|
||||
{
|
||||
public class FormDoctors : FormAbstractList<Doctor>
|
||||
public class FormDoctors : FormAbstractList<Doctor, DoctorViewModel, DoctorSearchModel>
|
||||
{
|
||||
public FormDoctors(ILogger<FormAbstractList<Doctor>> logger, IStorage<Doctor> storage) : base(logger, storage)
|
||||
public FormDoctors(
|
||||
ILogger<FormDoctors> logger,
|
||||
ILogic<Doctor, DoctorViewModel, DoctorSearchModel> logic) : base(logger, logic)
|
||||
{
|
||||
Text = "Список врачей";
|
||||
}
|
||||
|
2
Medical/MedicalView/FormAbstractList.Designer.cs
generated
2
Medical/MedicalView/FormAbstractList.Designer.cs
generated
@ -1,6 +1,6 @@
|
||||
namespace MedicalView
|
||||
{
|
||||
partial class FormAbstractList<T>
|
||||
partial class FormAbstractList<M, V, S>
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
|
@ -1,18 +1,23 @@
|
||||
using MedicalDatabaseContracts;
|
||||
using MedicalDatabaseContracts.Models;
|
||||
using MedicalDatabaseContracts.SearchModels;
|
||||
using MedicalDatabaseContracts.ViewModels;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MedicalView
|
||||
{
|
||||
public partial class FormAbstractList<T> : Form where T : AbstractModel
|
||||
public partial class FormAbstractList<M, V, S> : Form
|
||||
where M : AbstractModel
|
||||
where V : AbstractViewModel
|
||||
where S : AbstractSearchModel
|
||||
{
|
||||
protected ILogger _logger;
|
||||
protected IStorage<T> _storage;
|
||||
public FormAbstractList(ILogger<FormAbstractList<T>> logger, IStorage<T> storage)
|
||||
protected ILogic<M, V, S> _logic;
|
||||
public FormAbstractList(ILogger<FormAbstractList<M, V, S>> logger, ILogic<M, V, S> logic)
|
||||
{
|
||||
InitializeComponent();
|
||||
_logger = logger;
|
||||
_storage = storage;
|
||||
_logic = logic;
|
||||
}
|
||||
|
||||
private void FormAbstractList_Load(object sender, EventArgs e)
|
||||
@ -46,11 +51,11 @@ namespace MedicalView
|
||||
try
|
||||
{
|
||||
long elapsed;
|
||||
var items = _storage.GetAll(out elapsed);
|
||||
var items = _logic.ReadList(null, out elapsed);
|
||||
|
||||
dataGridView.DataSource = items;
|
||||
dataGridView.Columns["Id"].DisplayIndex = 0;
|
||||
foreach (DataGridViewTextBoxColumn column in dataGridView.Columns)
|
||||
foreach (DataGridViewColumn column in dataGridView.Columns)
|
||||
{
|
||||
if (column.Name.Contains("Id"))
|
||||
{
|
||||
|
@ -1,12 +1,16 @@
|
||||
using MedicalDatabaseContracts;
|
||||
using MedicalDatabaseContracts.Models;
|
||||
using MedicalDatabaseContracts.SearchModels;
|
||||
using MedicalDatabaseContracts.ViewModels;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MedicalView.Patients
|
||||
{
|
||||
public class FormPatients : FormAbstractList<Patient>
|
||||
public class FormPatients : FormAbstractList<Patient, PatientViewModel, PatientSearchModel>
|
||||
{
|
||||
public FormPatients(ILogger<FormAbstractList<Patient>> logger, IStorage<Patient> storage) : base(logger, storage)
|
||||
public FormPatients(
|
||||
ILogger<FormPatients> logger,
|
||||
ILogic<Patient, PatientViewModel, PatientSearchModel> logic) : base(logger, logic)
|
||||
{
|
||||
Text = "Список пациентов";
|
||||
}
|
||||
|
@ -1,12 +1,16 @@
|
||||
using MedicalDatabaseContracts;
|
||||
using MedicalDatabaseContracts.Models;
|
||||
using MedicalDatabaseContracts.SearchModels;
|
||||
using MedicalDatabaseContracts.ViewModels;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MedicalView.Specializations
|
||||
{
|
||||
public class FormSpecializations : FormAbstractList<Specialization>
|
||||
public class FormSpecializations : FormAbstractList<Specialization, SpecializationViewModel, SpecializationSearchModel>
|
||||
{
|
||||
public FormSpecializations(ILogger<FormAbstractList<Specialization>> logger, IStorage<Specialization> storage) : base(logger, storage)
|
||||
public FormSpecializations(
|
||||
ILogger<FormSpecializations> logger,
|
||||
ILogic<Specialization, SpecializationViewModel, SpecializationSearchModel> logic) : base(logger, logic)
|
||||
{
|
||||
Text = "Список специализаций";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user