поправила медикаменты - круды для них работают

This commit is contained in:
Елена Бакальская 2024-05-28 21:53:46 +04:00
parent 7eb6e50cd6
commit 9d840a764e
4 changed files with 30 additions and 27 deletions

View File

@ -99,10 +99,6 @@ namespace PolyclinicBusinessLogic.BusinessLogics
{
throw new ArgumentNullException("Какой-то неправильный идентификатор процедуры...", nameof(model));
}
if (string.IsNullOrEmpty(model.Comment))
{
throw new ArgumentNullException("Нет комментария", nameof(model.Comment));
}
if (string.IsNullOrEmpty(model.Name))
{
throw new ArgumentNullException("Нет названия у препарата", nameof(model.Comment));

View File

@ -40,6 +40,8 @@ namespace PolyclinicDatabaseImplement.Models
{
Name = bindingModel.Name;
Comment = bindingModel.Comment;
ProcedureId = bindingModel.ProcedureId;
SymptomId = bindingModel.SymptomId;
}
public MedicamentViewModel GetViewModel => new()

View File

@ -171,6 +171,8 @@ namespace PolyclinicWebAppSuretor.Controllers
[HttpPost]
public IActionResult EditMedicament(MedicamentViewModel model)
{
ViewBag.Procedures = _procedureLogic.ReadList(null);
ViewBag.Symptomes = _symptomLogic.ReadList(null);
if (HttpContext.Request.Method == "GET")
{
var obj = _medicamentLogic.ReadElement(new MedicamentSearchModel { Id = model.Id });

View File

@ -43,8 +43,10 @@
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>@item.Id</td>
<td>@item.Name</td>
<td>@item.SymptomName</td>
@ -70,6 +72,7 @@
</form>
</td>
</tr>
}
</tbody>
</table>