2024-04-30 16:53:50 +04:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2024-05-26 18:16:46 +04:00
|
|
|
|
using PolyclinicBusinessLogic.BusinessLogics;
|
|
|
|
|
using PolyclinicContracts.BindingModels;
|
2024-05-26 13:45:07 +04:00
|
|
|
|
using PolyclinicContracts.BusinessLogicsContracts;
|
2024-05-26 18:16:46 +04:00
|
|
|
|
using PolyclinicContracts.SearchModels;
|
2024-05-26 13:45:07 +04:00
|
|
|
|
using PolyclinicContracts.ViewModels;
|
2024-04-30 16:53:50 +04:00
|
|
|
|
using PolyclinicWebAppSuretor.Models;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
|
|
|
|
namespace PolyclinicWebAppSuretor.Controllers
|
|
|
|
|
{
|
|
|
|
|
public class HomeController : Controller
|
|
|
|
|
{
|
|
|
|
|
private readonly ILogger<HomeController> _logger;
|
2024-05-26 13:45:07 +04:00
|
|
|
|
private readonly IProcedureLogic _procedureLogic;
|
2024-04-30 16:53:50 +04:00
|
|
|
|
|
2024-05-26 13:45:07 +04:00
|
|
|
|
public HomeController(ILogger<HomeController> logger, IProcedureLogic procedureLogic)
|
2024-04-30 16:53:50 +04:00
|
|
|
|
{
|
|
|
|
|
_logger = logger;
|
2024-05-26 13:45:07 +04:00
|
|
|
|
_procedureLogic = procedureLogic;
|
2024-04-30 16:53:50 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IActionResult Index()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IActionResult Privacy()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-30 19:59:10 +04:00
|
|
|
|
public IActionResult Medicaments()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IActionResult Procedures()
|
|
|
|
|
{
|
2024-05-26 13:45:07 +04:00
|
|
|
|
List<ProcedureViewModel> procedure = _procedureLogic.ReadList(null);
|
|
|
|
|
if (procedure == null)
|
|
|
|
|
{
|
|
|
|
|
procedure = new();
|
|
|
|
|
}
|
|
|
|
|
return View(procedure);
|
2024-04-30 19:59:10 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IActionResult Recipes()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-30 21:24:45 +04:00
|
|
|
|
public IActionResult CreateRecipe()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-26 18:16:46 +04:00
|
|
|
|
[HttpGet]
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public IActionResult CreateProcedure(string name, string? comment, DateTime dateStart, DateTime? dateStop)
|
2024-05-01 00:55:32 +04:00
|
|
|
|
{
|
2024-05-26 18:16:46 +04:00
|
|
|
|
if (HttpContext.Request.Method == "GET")
|
|
|
|
|
{
|
|
|
|
|
ViewData["Title"] = "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// TODO <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UserId
|
|
|
|
|
ProcedureBindingModel procedure = new ProcedureBindingModel
|
|
|
|
|
{
|
|
|
|
|
Name = name,
|
|
|
|
|
Comment = comment ?? string.Empty,
|
|
|
|
|
DateStartProcedure = dateStart,
|
|
|
|
|
DateStopProcedure = dateStop
|
|
|
|
|
};
|
|
|
|
|
_procedureLogic.Create(procedure);
|
|
|
|
|
return RedirectToAction("Procedures");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public IActionResult Edit(int id, string name, string comment, DateTime dateStart, DateTime? dateStop)
|
|
|
|
|
{
|
|
|
|
|
if (HttpContext.Request.Method == "GET")
|
|
|
|
|
{
|
|
|
|
|
var obj = _procedureLogic.ReadElement(new ProcedureSearchModel { Id = id });
|
|
|
|
|
ViewData["Title"] = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
return View(obj);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ProcedureBindingModel procedure = new ProcedureBindingModel
|
|
|
|
|
{
|
|
|
|
|
Id = id,
|
|
|
|
|
Name = name,
|
|
|
|
|
Comment = comment ?? string.Empty,
|
|
|
|
|
DateStartProcedure = dateStart,
|
|
|
|
|
DateStopProcedure = dateStop
|
|
|
|
|
};
|
|
|
|
|
_procedureLogic.Update(procedure);
|
|
|
|
|
return RedirectToAction("Procedures");
|
|
|
|
|
}
|
2024-05-01 00:55:32 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IActionResult CreateMedicament()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
2024-05-01 14:47:46 +04:00
|
|
|
|
|
|
|
|
|
public IActionResult ListCoursesByProcedures()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
2024-05-01 00:55:32 +04:00
|
|
|
|
|
2024-05-01 18:01:42 +04:00
|
|
|
|
public IActionResult AddSymptomToMedicament()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public IActionResult ProceduresReport()
|
|
|
|
|
{
|
|
|
|
|
if (HttpContext.Request.Method == "POST")
|
|
|
|
|
{
|
|
|
|
|
ViewData["ShowReport"] = true;
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-01 15:18:32 +04:00
|
|
|
|
[HttpGet]
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public IActionResult Login()
|
|
|
|
|
{
|
|
|
|
|
if (HttpContext.Request.Method == "POST")
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-01 15:42:24 +04:00
|
|
|
|
[HttpGet]
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public IActionResult Register()
|
|
|
|
|
{
|
|
|
|
|
if (HttpContext.Request.Method == "POST")
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-30 16:53:50 +04:00
|
|
|
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
|
|
|
|
public IActionResult Error()
|
|
|
|
|
{
|
|
|
|
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|