Как давно я топчу, видно по каблуку.

This commit is contained in:
Allllen4a 2024-05-31 11:30:55 +04:00
parent d39bbb0e75
commit 3509b0e7c9
5 changed files with 109 additions and 95 deletions

View File

@ -1,49 +1,16 @@
@{
ViewData["Title"] = "Процедура";
@{
ViewData["Title"] = "Процедуры";
}
<h4 class="fw-bold">Создать процедуру</h4>
<h4 class="fw-bold">Создать процедуры</h4>
<p class="mb-0">Название процедуры:</p>
<input id="name-input" class="form-control mb-2" />
<p class="mb-0 fw-bold">Выбранная косметика:</p>
<div>
<table class="table mb-0">
<thead>
<tr>
<th>Бренд</th>
<th>Наименование косметики</th>
<th>Стоимость</th>
<th>Количество</th>
<th></th>
</tr>
</thead>
<tbody id="tbody">
<tr>
<td>Не выбрано</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<p class="mb-0 fw-bold">Добавить косметику:</p>
<p class="mb-0">Наименование:</p>
<select class="form-select mb-0" id="cosmetic-select"></select>
<p class="mb-0">Количество:</p>
<input type="number" min="1" value="1" id="count-input" class="form-control mb-2" />
<button id="add-button" class="button-primary">
Добавить
</button>
<p class="mb-0 fw-bold">Стоимость процедуры:</p>
<input type="number" step="0.01" id="price-input" class="form-control mb-2" value="0.01" readonly />
<button id="create-button" class="button-primary">
Создать
</button>
<script src="~/js/procedure-create.js" asp-append-version="true"></script>
<form method="post" asp-controller="Procedure" asp-action="Create">
<p class="mb-0">Название:</p>
<input type="text" name="ProcedureName" class="form-control mb-3" />
<p class="mb-0">Стоимость:</p>
<input type="number" step="0.01" min="0.01" name="ProcedurePrice" class="form-control mb-3" />
<p class="mb-0">Длительность процедуры:</p>
<input type="text" name="ProcedureDuration" class="form-control mb-3" />
Создать
</button>
</form>

View File

@ -0,0 +1,70 @@
@using BeautySalonContracts.ViewModels
@model List<ProcedureViewModel>
@{
ViewData["Title"] = "Процедуры";
}
<div class="text-center">
<h1 class="display-4">Процедуры</h1>
</div>
<div class="text-center">
@{
if (Model == null)
{
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
<p>
<a asp-action="CreateProcedure">Создать процедуры</a>
</p>
<table class="table">
<thead>
<tr>
<th>Номер</th>
<th>Название</th>
<th>Цена</th>
<th>Длительность</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var procedures in Model)
{
<tr>
<th>@procedures.Id</th>
<td>@procedures.ProcedureName</td>
<td>@procedures.ProcedurePrice</td>
<td>@procedures.ProcedureDuration</td>
<td>
<p><button type="button" class="btn btn-primary" onclick="location.href='@Url.Action("UpdateProcedure", "/Procedure", new { id = procedures.Id })'">Изменить</button></p>
</td>
<td>
<p><button type="button" class="btn btn-primary" onclick="deleteDisease(@procedures.Id)">Удалить</button></p>
</td>
</tr>
}
</tbody>
</table>
}
</div>
@section scripts {
<script>
function deleteCosmetic(id) {
if (confirm("Вы уверены, что хотите удалить косметику?")) {
$.post('@Url.Action("DeleteCosmetic", "/Cosmetic")' + '/' + id, function () {
window.location.reload();
});
}
}
</script>
}

View File

@ -1,51 +1,18 @@
@{
ViewData["Title"] = "Процедура";
@{
ViewData["Title"] = "Процедуры";
}
<h4 class="fw-bold">Обновить процедуру</h4>
<h4 class="fw-bold">Обновить процедуры</h4>
<p class="mb-0">Название процедуры:</p>
<input id="name-input" class="form-control mb-2" />
<p class="mb-0 fw-bold">Выбранная косметика:</p>
<div>
<table class="table mb-0">
<thead>
<tr>
<th>Бренд</th>
<th>Наименование косметики</th>
<th>Стоимость</th>
<th>Количество</th>
<th></th>
</tr>
</thead>
<tbody id="tbody">
<tr>
<td>Не выбрано</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<p class="mb-0 fw-bold">Добавить косметику:</p>
<p class="mb-0">Наименование:</p>
<select class="form-select mb-0" id="cosmetic-select"></select>
<p class="mb-0">Количество:</p>
<input type="number" min="1" value="1" id="count-input" class="form-control mb-2" />
<button id="add-button" class="button-primary">
Добавить
</button>
<p class="mb-0 fw-bold">Стоимость процедуры:</p>
<input type="number" step="0.01" id="price-input" class="form-control mb-2" value="0.01" readonly />
<button id="update-button" class="button-primary">
Обновить
</button>
<input id="id" value="@ViewBag.Id" style="display: none;" />
<script src="~/js/procedure-update.js" asp-append-version="true"></script>
<form method="post" asp-controller="Cosmetic" asp-action="Update">
<input name="id" value="@ViewBag.Cosmetic.Id" style="display: none;" />
<p class="mb-0">Название:</p>
<input type="text" name="ProcedureName" class="form-control mb-3" />
<p class="mb-0">Стоимость:</p>
<input type="number" step="0.01" min="0.01" name="ProcedurePrice" class="form-control mb-3" />
<p class="mb-0">Длительность процедуры:</p>
<input type="text" name="ProcedureDuration" class="form-control mb-3" />
<button type="submit" class="button-primary">
Обновить
</button>
</form>

View File

@ -32,7 +32,7 @@
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Авторизация</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Procedure">Процедуры</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Procedure" asp-action="Procedures">Процедуры</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Order">Заказы</a>

View File

@ -6,6 +6,16 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Content Remove="Views\Procedure\Create.cshtml" />
<Content Remove="Views\Procedure\Update.cshtml" />
</ItemGroup>
<ItemGroup>
<None Include="Views\Procedure\Create.cshtml" />
<None Include="Views\Procedure\Update.cshtml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>