31 lines
896 B
C#
31 lines
896 B
C#
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
using PolyclinicContracts.BusinessLogicsContracts;
|
|||
|
using PolyclinicContracts.ViewModels;
|
|||
|
using PolyclinicWebAppImplementer.Models;
|
|||
|
|
|||
|
namespace PolyclinicWebAppImplementer.Controllers
|
|||
|
{
|
|||
|
public class DiagnosesController : Controller
|
|||
|
{
|
|||
|
private readonly ILogger<DiagnosesController> _logger;
|
|||
|
private readonly IDiagnoseLogic _diagnoseLogic;
|
|||
|
|
|||
|
public DiagnosesController(ILogger<DiagnosesController> logger, IDiagnoseLogic diagnoseLogic)
|
|||
|
{
|
|||
|
_logger = logger;
|
|||
|
_diagnoseLogic = diagnoseLogic;
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet]
|
|||
|
public IActionResult Index()
|
|||
|
{
|
|||
|
List<DiagnoseViewModel> diagnoses = _diagnoseLogic.ReadList(null);
|
|||
|
if (diagnoses == null)
|
|||
|
{
|
|||
|
diagnoses = new();
|
|||
|
}
|
|||
|
return View(diagnoses);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|