antoc0der 2024-05-02 10:02:31 +04:00
commit b02889bdc3
5 changed files with 112 additions and 0 deletions

View File

@ -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("Животное с таким названием уже есть");
}
}
}
}

View File

@ -385,5 +385,16 @@ namespace VeterinaryShowOwnerApp.Controllers
}
return result;
}
[HttpGet]
public IActionResult ServiceListReport()
{
ViewBag.Services = APIOwner.GetRequest<List<ServiceViewModel>>($"api/pet/getpets?ownerid={APIOwner.Owner.Id}");
return View();
}
[HttpGet]
public IActionResult Report()
{
return View();
}
}
}

View File

@ -0,0 +1,59 @@
@{
ViewData["Title"] = "Report";
}
<div class="text-center">
<h1 class="display-4">Список животных с расшифровкой по посещениям и лекарствам</h1>
</div>
<div class="text-center">
@{
if (Model == null)
{
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
<div class="row mb-5">
<div class="col-4">Начальная дата:</div>
<div class="col-8">
<input type="date" id="startDate" name="startDate" class="form-control">
</div>
</div>
<div class="row mb-5">
<div class="col-4">Конечная дата:</div>
<div class="col-8">
<input type="date" id="endDate" name="endDate" class="form-control">
</div>
</div>
<table class="table">
<thead>
<tr>
<th>
Номер
</th>
<th>
Дата
</th>
<th>
Животное
</th>
<th>
Посещение
</th>
<th>
Лекарство
</th>
</tr>
</thead>
<tbody>
будет заполняться вьюшками отчета
</tbody>
</table>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Создать отчет" class="btn btn-primary" /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Отправить на почту" class="btn btn-primary" /></div>
</div>
}
</div>

View File

@ -0,0 +1,27 @@
@using VeterinaryContracts.ViewModels;
@{
ViewData["Title"] = "ServiceListReport";
}
<div class="text-center">
<h2 class="display-4">Создать списки услуг для животных</h2>
</div>
<form method="post">
<div class="row">
<div class="col-4">Животные:</div>
<div class="col-8">
<select name="pets" class="form-control" multiple size="5" id="pets">
@foreach (var service in ViewBag.Pets)
{
<option value="@service.Id">@service.PetName</option>
}
</select>
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-2"><input type="submit" value="Word" class="btn btn-primary" /></div>
<div class="col-1"><input type="submit" value="Excel" class="btn btn-primary" /></div>
</div>
</form>

View File

@ -37,6 +37,12 @@
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Register">Регистрация</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="ServiceListReport">Выгрузка списка</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Report">Отчет</a>
</li>
</ul>
</div>
</div>