Поменял сигнатцрц функций в контроллере диагнозов
This commit is contained in:
parent
c5b0f0fe6c
commit
4b5cf5582e
@ -29,7 +29,7 @@ namespace PolyclinicWebAppImplementer.Controllers
|
||||
|
||||
[HttpGet]
|
||||
[HttpPost]
|
||||
public IActionResult Add(string name, string? comment, DateTime dateStart, DateTime? dateStop)
|
||||
public IActionResult Add(DiagnoseViewModel model)
|
||||
{
|
||||
if (HttpContext.Request.Method == "GET")
|
||||
{
|
||||
@ -41,10 +41,10 @@ namespace PolyclinicWebAppImplementer.Controllers
|
||||
// TODO прописать UserId
|
||||
DiagnoseBindingModel diagnose = new DiagnoseBindingModel
|
||||
{
|
||||
Name = name,
|
||||
Comment = comment,
|
||||
DateStartDiagnose = dateStart,
|
||||
DateStopDiagnose = dateStop,
|
||||
Name = model.Name,
|
||||
Comment = model.Comment,
|
||||
DateStartDiagnose = model.DateStartDiagnose,
|
||||
DateStopDiagnose = model.DateStopDiagnose,
|
||||
};
|
||||
_diagnoseLogic.Create(diagnose);
|
||||
return RedirectToAction("Index");
|
||||
@ -53,7 +53,7 @@ namespace PolyclinicWebAppImplementer.Controllers
|
||||
|
||||
[HttpGet]
|
||||
[HttpPost]
|
||||
public IActionResult Edit(int id, string name, string? comment, DateTime dateStart, DateTime? dateStop)
|
||||
public IActionResult Edit(int id, DiagnoseViewModel model)
|
||||
{
|
||||
if (HttpContext.Request.Method == "GET")
|
||||
{
|
||||
@ -65,11 +65,11 @@ namespace PolyclinicWebAppImplementer.Controllers
|
||||
{
|
||||
DiagnoseBindingModel diagnose = new DiagnoseBindingModel
|
||||
{
|
||||
Id = id,
|
||||
Name = name,
|
||||
Comment = comment,
|
||||
DateStartDiagnose = dateStart,
|
||||
DateStopDiagnose = dateStop,
|
||||
Id = model.Id,
|
||||
Name = model.Name,
|
||||
Comment = model.Comment,
|
||||
DateStartDiagnose = model.DateStartDiagnose,
|
||||
DateStopDiagnose = model.DateStopDiagnose,
|
||||
};
|
||||
_diagnoseLogic.Update(diagnose);
|
||||
return RedirectToAction("Index");
|
||||
|
@ -2,22 +2,22 @@
|
||||
@model DiagnoseViewModel
|
||||
<h4>@ViewData["Title"]</h4>
|
||||
<form class="d-flex flex-column" method="post">
|
||||
<input type="hidden" name="id" readonly asp-for="Id" />
|
||||
<input type="hidden" readonly asp-for="Id" />
|
||||
<div class="row mb-5">
|
||||
<div class="col-3">Название:</div>
|
||||
<div class="col-8"><input required type="text" id="name" name="name" asp-for="Name" /></div>
|
||||
<div class="col-8"><input required asp-for="Name" /></div>
|
||||
</div>
|
||||
<div class="row mb-5">
|
||||
<div class="col-3">Коментарий:</div>
|
||||
<div class="col-8"><textarea id="comment" name="comment" asp-for="Comment"></textarea></div>
|
||||
<div class="col-8"><textarea asp-for="Comment"></textarea></div>
|
||||
</div>
|
||||
<div class="row mb-5">
|
||||
<div class="col-3">Начало:</div>
|
||||
<div class="col-8"><input required type="date" id="dateStartInput" name="dateStart" asp-for="DateStartDiagnose" /></div>
|
||||
<div class="col-8"><input required type="date" asp-for="DateStartDiagnose" /></div>
|
||||
</div>
|
||||
<div class="row mb-5">
|
||||
<div class="col-3">Конец:</div>
|
||||
<div class="col-8"><input type="date" id="dateStopInput" name="dateStop" asp-for="DateStopDiagnose" value="" placeholder=""/></div>
|
||||
<div class="col-8"><input type="date" asp-for="DateStopDiagnose" /></div>
|
||||
</div>
|
||||
<div class="row mb-5">
|
||||
<div class="col-4">
|
||||
|
Loading…
Reference in New Issue
Block a user