From a0792627a6bc9be24402d4906c9873b1ce14c803 Mon Sep 17 00:00:00 2001 From: Yunusov_Niyaz Date: Wed, 1 May 2024 22:36:14 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D1=8C:=F0=9F=9A=AD=D0=BD=D0=B0=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=BA=D1=83=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogic/PetLogic.cs | 9 +++ .../Controllers/HomeController.cs | 11 ++++ .../Views/Home/Report.cshtml | 59 +++++++++++++++++++ .../Views/Home/ServiceListReport.cshtml | 27 +++++++++ .../Views/Shared/_Layout.cshtml | 6 ++ 5 files changed, 112 insertions(+) create mode 100644 VeterinaryView/VeterinaryShowOwnerApp/Views/Home/Report.cshtml create mode 100644 VeterinaryView/VeterinaryShowOwnerApp/Views/Home/ServiceListReport.cshtml diff --git a/VeterinaryView/VeterinaryBusinessLogic/BusinessLogic/PetLogic.cs b/VeterinaryView/VeterinaryBusinessLogic/BusinessLogic/PetLogic.cs index 537874b..85505e3 100644 --- a/VeterinaryView/VeterinaryBusinessLogic/BusinessLogic/PetLogic.cs +++ b/VeterinaryView/VeterinaryBusinessLogic/BusinessLogic/PetLogic.cs @@ -109,6 +109,15 @@ namespace VeterinaryBusinessLogic.BusinessLogic } _logger.LogInformation("Pet. PetName:{PetName}." + "PetType:{ PetType}. PetBreed:{ PetBreed}. PetGender:{ PetGender}. Id: { Id} ", model.PetName, model.PetType, model.PetBreed, model.PetGender, model.Id); + var element = _petStorage.GetElement(new PetSearchModel + { + PetName = model.PetName + + }); + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("Животное с таким названием уже есть"); + } } } } diff --git a/VeterinaryView/VeterinaryShowOwnerApp/Controllers/HomeController.cs b/VeterinaryView/VeterinaryShowOwnerApp/Controllers/HomeController.cs index 3eb0418..faaa92c 100644 --- a/VeterinaryView/VeterinaryShowOwnerApp/Controllers/HomeController.cs +++ b/VeterinaryView/VeterinaryShowOwnerApp/Controllers/HomeController.cs @@ -385,5 +385,16 @@ namespace VeterinaryShowOwnerApp.Controllers } return result; } + [HttpGet] + public IActionResult ServiceListReport() + { + ViewBag.Services = APIOwner.GetRequest>($"api/pet/getpets?ownerid={APIOwner.Owner.Id}"); + return View(); + } + [HttpGet] + public IActionResult Report() + { + return View(); + } } } \ No newline at end of file diff --git a/VeterinaryView/VeterinaryShowOwnerApp/Views/Home/Report.cshtml b/VeterinaryView/VeterinaryShowOwnerApp/Views/Home/Report.cshtml new file mode 100644 index 0000000..fcebdeb --- /dev/null +++ b/VeterinaryView/VeterinaryShowOwnerApp/Views/Home/Report.cshtml @@ -0,0 +1,59 @@ +@{ + ViewData["Title"] = "Report"; +} +
+

Список животных с расшифровкой по посещениям и лекарствам

+
+
+ @{ + if (Model == null) + { +

Авторизируйтесь

+ return; + } +
+
Начальная дата:
+
+ +
+
+
+
Конечная дата:
+
+ +
+
+ + + + + + + + + + + + будет заполняться вьюшками отчета + +
+ Номер + + Дата + + Животное + + Посещение + + Лекарство +
+
+
+
+
+
+
+
+
+ } +
\ No newline at end of file diff --git a/VeterinaryView/VeterinaryShowOwnerApp/Views/Home/ServiceListReport.cshtml b/VeterinaryView/VeterinaryShowOwnerApp/Views/Home/ServiceListReport.cshtml new file mode 100644 index 0000000..b6538e7 --- /dev/null +++ b/VeterinaryView/VeterinaryShowOwnerApp/Views/Home/ServiceListReport.cshtml @@ -0,0 +1,27 @@ +@using VeterinaryContracts.ViewModels; + +@{ + ViewData["Title"] = "ServiceListReport"; +} + +
+

Создать списки услуг для животных

+
+
+
+
Животные:
+
+ +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/VeterinaryView/VeterinaryShowOwnerApp/Views/Shared/_Layout.cshtml b/VeterinaryView/VeterinaryShowOwnerApp/Views/Shared/_Layout.cshtml index 246d539..6060d39 100644 --- a/VeterinaryView/VeterinaryShowOwnerApp/Views/Shared/_Layout.cshtml +++ b/VeterinaryView/VeterinaryShowOwnerApp/Views/Shared/_Layout.cshtml @@ -37,6 +37,12 @@ + +