diff --git a/VeterinaryView/VeterinaryDatabaseImplement/Implements/VisitStorage.cs b/VeterinaryView/VeterinaryDatabaseImplement/Implements/VisitStorage.cs index 9606579..a0df76f 100644 --- a/VeterinaryView/VeterinaryDatabaseImplement/Implements/VisitStorage.cs +++ b/VeterinaryView/VeterinaryDatabaseImplement/Implements/VisitStorage.cs @@ -18,10 +18,7 @@ namespace VeterinaryDatabaseImplement.Implements } public List GetFilteredList(VisitSearchModel model) { - if (string.IsNullOrEmpty(model.VisitName)) - { - return new(); - } + using var context = new VeterinaryDatabase(); return context.Visits.Include(x => x.Owner).Include(x => x.Pets).ThenInclude(x => x.Pet).Include(x => x.Doctor) .Where(x => ((!model.Id.HasValue || x.Id == model.Id) && diff --git a/VeterinaryView/VeterinaryRestApi/Controllers/VisitController.cs b/VeterinaryView/VeterinaryRestApi/Controllers/VisitController.cs index 6fbb295..bc87d76 100644 --- a/VeterinaryView/VeterinaryRestApi/Controllers/VisitController.cs +++ b/VeterinaryView/VeterinaryRestApi/Controllers/VisitController.cs @@ -75,5 +75,19 @@ namespace VeterinaryRestApi.Controllers throw; } } + + [HttpPost] + public bool UpdateVisit(VisitBindingModel model) + { + try + { + return _visit.Update(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Не удалось обновить лекарства"); + throw; + } + } } } diff --git a/VeterinaryView/VeterinaryShowOwnerApp/Controllers/HomeController.cs b/VeterinaryView/VeterinaryShowOwnerApp/Controllers/HomeController.cs index 1ee56dd..146e5c4 100644 --- a/VeterinaryView/VeterinaryShowOwnerApp/Controllers/HomeController.cs +++ b/VeterinaryView/VeterinaryShowOwnerApp/Controllers/HomeController.cs @@ -206,6 +206,7 @@ namespace VeterinaryShowOwnerApp.Controllers } return result; } + [HttpGet] public IActionResult Visits() { if (APIOwner.Owner == null) diff --git a/VeterinaryView/VeterinaryShowOwnerApp/Views/Home/UpdateVisit.cshtml b/VeterinaryView/VeterinaryShowOwnerApp/Views/Home/UpdateVisit.cshtml index 6e9de59..7f9a9e2 100644 --- a/VeterinaryView/VeterinaryShowOwnerApp/Views/Home/UpdateVisit.cshtml +++ b/VeterinaryView/VeterinaryShowOwnerApp/Views/Home/UpdateVisit.cshtml @@ -22,4 +22,27 @@
- \ No newline at end of file + + +@section Scripts + { + +} \ No newline at end of file