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 @@ + +