diff --git a/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/MedicamentLogic.cs b/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/MedicamentLogic.cs index 116abc8..6b3094f 100644 --- a/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/MedicamentLogic.cs +++ b/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/MedicamentLogic.cs @@ -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)); diff --git a/Polyclinic/PolyclinicDatabaseImplement/Models/Medicament.cs b/Polyclinic/PolyclinicDatabaseImplement/Models/Medicament.cs index a120cf4..caf7481 100644 --- a/Polyclinic/PolyclinicDatabaseImplement/Models/Medicament.cs +++ b/Polyclinic/PolyclinicDatabaseImplement/Models/Medicament.cs @@ -40,6 +40,8 @@ namespace PolyclinicDatabaseImplement.Models { Name = bindingModel.Name; Comment = bindingModel.Comment; + ProcedureId = bindingModel.ProcedureId; + SymptomId = bindingModel.SymptomId; } public MedicamentViewModel GetViewModel => new() diff --git a/Polyclinic/PolyclinicWebAppSuretor/Controllers/HomeController.cs b/Polyclinic/PolyclinicWebAppSuretor/Controllers/HomeController.cs index 838c470..680ed67 100644 --- a/Polyclinic/PolyclinicWebAppSuretor/Controllers/HomeController.cs +++ b/Polyclinic/PolyclinicWebAppSuretor/Controllers/HomeController.cs @@ -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 }); diff --git a/Polyclinic/PolyclinicWebAppSuretor/Views/Home/Medicaments.cshtml b/Polyclinic/PolyclinicWebAppSuretor/Views/Home/Medicaments.cshtml index 4df7240..e3d1457 100644 --- a/Polyclinic/PolyclinicWebAppSuretor/Views/Home/Medicaments.cshtml +++ b/Polyclinic/PolyclinicWebAppSuretor/Views/Home/Medicaments.cshtml @@ -43,33 +43,36 @@
+ @foreach (var item in Model) { -