поправила даты и редактирование процедур
This commit is contained in:
parent
13ecdcaecc
commit
bd594232f9
@ -36,10 +36,16 @@ namespace PolyclinicDatabaseImplement.Models
|
||||
};
|
||||
}
|
||||
|
||||
public void Update(ProcedureBindingModel bindingModel)
|
||||
public void Update(ProcedureBindingModel? bindingModel)
|
||||
{
|
||||
if (bindingModel == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Name = bindingModel.Name;
|
||||
Comment = bindingModel.Comment;
|
||||
DateStartProcedure = bindingModel.DateStartProcedure;
|
||||
DateStopProcedure = bindingModel.DateStopProcedure;
|
||||
}
|
||||
|
||||
public ProcedureViewModel GetViewModel => new()
|
||||
|
@ -78,25 +78,26 @@ namespace PolyclinicWebAppSuretor.Controllers
|
||||
return RedirectToAction("Procedures");
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[HttpPost]
|
||||
public IActionResult Edit(int id,string name, string comment, DateTime dateStart, DateTime? dateStop)
|
||||
public IActionResult EditProcedure(ProcedureViewModel model)
|
||||
{
|
||||
if (HttpContext.Request.Method == "GET")
|
||||
{
|
||||
var obj = _procedureLogic.ReadElement(new ProcedureSearchModel { Id = id });
|
||||
var obj = _procedureLogic.ReadElement(new ProcedureSearchModel { Id = model.Id });
|
||||
ViewData["Title"] = "Ðåäàêòèðîâàòü ïðîöåäóðó";
|
||||
return View(obj);
|
||||
return View("CreateProcedure", obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcedureBindingModel procedure = new ProcedureBindingModel
|
||||
{
|
||||
Id = id,
|
||||
Name = name,
|
||||
Comment = comment,
|
||||
DateStartProcedure = dateStart,
|
||||
DateStopProcedure = dateStop
|
||||
Id = model.Id,
|
||||
Name = model.Name,
|
||||
Comment = model.Comment,
|
||||
DateStartProcedure = model.DateStartProcedure,
|
||||
DateStopProcedure = model.DateStopProcedure
|
||||
};
|
||||
_procedureLogic.Update(procedure);
|
||||
return RedirectToAction("Procedures");
|
||||
@ -107,7 +108,7 @@ namespace PolyclinicWebAppSuretor.Controllers
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
public IActionResult ListCoursesByProcedures()
|
||||
{
|
||||
return View();
|
||||
@ -117,7 +118,7 @@ namespace PolyclinicWebAppSuretor.Controllers
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
[HttpGet]
|
||||
[HttpPost]
|
||||
public IActionResult ProceduresReport()
|
||||
|
@ -1,28 +1,26 @@
|
||||
@using PolyclinicContracts.ViewModels
|
||||
@model ProcedureViewModel
|
||||
@{
|
||||
ViewData["Title"] = "CreateProcedure";
|
||||
}
|
||||
|
||||
<div class="text-center mt-3 mb-3">
|
||||
<h2 class="display-4">Создание процедуры</h2>
|
||||
<h3>@ViewData["Title"]</h3>
|
||||
</div>
|
||||
|
||||
<form method="post" class="form-create-procedure d-flex flex-row justify-content-around align-items-center">
|
||||
|
||||
<div class="procedure-info d-flex flex-column mb-5 mt-5">
|
||||
<input type="hidden" name="id" readonly asp-for="Id" />
|
||||
<input type="hidden" readonly asp-for="Id" />
|
||||
<div class="d-flex flex-row mb-5 flex-row justify-content-between align-items-center">
|
||||
<h3 class="col-3 m-3">
|
||||
Название:
|
||||
</h3>
|
||||
<input required type="text" id="name" name="name" asp-for="Name" />
|
||||
<input required type="text" asp-for="Name" />
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-row mb-5 flex-row justify-content-between align-items-center">
|
||||
<h3 class="col-3 m-3">
|
||||
Комментарий:
|
||||
</h3>
|
||||
<textarea type="text" id="comment" name="comment" asp-for="Comment" style="width: 45vh">
|
||||
<textarea type="text" asp-for="Comment" style="width: 45vh">
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@ -32,13 +30,13 @@
|
||||
<label for="dateStart" class="me-3">
|
||||
Дата начала
|
||||
</label>
|
||||
<input type="date" id="dateStart" name="dateStart" asp-for="DateStartProcedure" />
|
||||
<input type="date" id="dateStart" asp-for="DateStartProcedure" />
|
||||
</div>
|
||||
<div class="mb-5 me-3">
|
||||
<label for="dateStop" class="me-3">
|
||||
Дата завершения
|
||||
</label>
|
||||
<input type="date" id="dateStop" name="dateStop" asp-for="DateStopProcedure" />
|
||||
<input type="date" id="dateStop" asp-for="DateStopProcedure" />
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<input type="submit" value="Сохранить" class="button-save-procedure btn" />
|
||||
|
@ -38,23 +38,26 @@
|
||||
{
|
||||
<tr>
|
||||
<td scope="row">@Html.DisplayFor(modelItem => item.Id)</td>
|
||||
<td>@Html.DisplayFor(modelItem => item.Name)</td>
|
||||
<td>@Html.DisplayFor(modelItem => item.DateStartProcedure)</td>
|
||||
<td>@Html.DisplayFor(modelItem => item.DateStopProcedure)</td>
|
||||
<td>@Html.DisplayFor(modelItem => item.Comment)</td>
|
||||
<td>@item.Name</td>
|
||||
<td>@item.DateStartProcedure.ToShortDateString()</td>
|
||||
<td>@item.DateStopProcedure?.ToShortDateString()</td>
|
||||
<td>@item.Comment</td>
|
||||
<td>
|
||||
<a asp-action="CreateProcedure">
|
||||
<a asp-action="EditProcedure" asp-route-id="@item.Id">
|
||||
<svg class="bi-edit-pen" viewBox="0 0 127 127" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M105.5 26L37 114.5C34.5 117 16.3 121.7 7.5 122.5C79.1 34.1 101 5.5 102 4C104.833 4.5 119.3 14.6 122.5 21C105 44 98.5 55 111.5 58.5" stroke="#008315" stroke-width="6" stroke-linecap="round" />
|
||||
</svg>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<svg class="bi-cart-delete" viewBox="0 0 154 164" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M44.5 123C4.99995 119.5 -11.8431 56.4293 24 19.5C40.5 2.50001 72.5 -5.5 101.5 27.5L115.5 14.5" stroke="#D10000" stroke-width="8" stroke-linecap="round" />
|
||||
<path d="M65.2123 159.963L56 60.0001C88.0236 76.3307 119.521 77.4194 149 60.0001C141.63 142.346 140.08 160.953 140.226 159.963H65.2123Z" stroke="#D10000" stroke-width="8" />
|
||||
<path d="M121 36L101.582 55L75 31" stroke="#D10000" stroke-width="8" stroke-linecap="round" />
|
||||
</svg>
|
||||
<a asp-action="DeleteProcedure">
|
||||
<svg class="bi-cart-delete" viewBox="0 0 154 164" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M44.5 123C4.99995 119.5 -11.8431 56.4293 24 19.5C40.5 2.50001 72.5 -5.5 101.5 27.5L115.5 14.5" stroke="#D10000" stroke-width="8" stroke-linecap="round" />
|
||||
<path d="M65.2123 159.963L56 60.0001C88.0236 76.3307 119.521 77.4194 149 60.0001C141.63 142.346 140.08 160.953 140.226 159.963H65.2123Z" stroke="#D10000" stroke-width="8" />
|
||||
<path d="M121 36L101.582 55L75 31" stroke="#D10000" stroke-width="8" stroke-linecap="round" />
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user