This commit is contained in:
kagbie3nn@mail.ru 2024-05-31 14:26:21 +04:00
parent 8337e7d847
commit 2386fa98e7
4 changed files with 19 additions and 24 deletions

View File

@ -138,13 +138,13 @@ namespace ZooShowEmployeeApp.Controllers
return View();
}
[HttpPost]
public void CreatePreserve(string name, double price)
public void CreatePreserve(string name, int price)
{
if (APIEmployee.Employee == null)
{
throw new Exception("Вы как суда попали? Сюда вход только авторизованным");
}
if (string.IsNullOrEmpty(name) || price <= 0 )
if (string.IsNullOrEmpty(name) || price <= 0)
{
throw new Exception("Ошибка в введённых данных");
}

View File

@ -5,23 +5,16 @@
<h2 class="display-4">Создание Заповедника</h2>
</div>
<form method="post">
<div class="row">
<div class="col-4">Название:</div>
<div class="col-8">
<select id="preserve" name="preserve" class="form-control" aspitems="@(new SelectList(@ViewBag.Preserve,"Id", "PreserveName"))"></select>
</div>
</div>
<div class="row">
<div class="col-4">Стоимость:</div>
<div class="col-8">
<input type="text" id="PreservePrice" name="PreservePrice" readonly />
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Создать" class="btn
btn-primary" />
</div>
</div>
</form>
<div class="row">
<div class="col-4">название:</div>
<div class="col-8"><input type="text" name="name" /></div>
</div>
<div class="row">
<div class="col-4">стоимость:</div>
<div class="col-8"><input type="text" name="price" /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>
</div>
</form>

View File

@ -5,8 +5,7 @@
<div class="text-center">
<h1 class="display-8">Приложение "Зоопарк "Юрский период". Исполнитель"</h1>
<div class="list-group">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="IndexPreserve">Заповедник</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="CreatePreserve">Заповедники</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="IndexPreserve">Заповедники</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Reports">Отчеты</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Вход</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>

View File

@ -34,6 +34,9 @@
<th>
Стоимость
</th>
<th>
Удалить животное
</th>
</tr>
</thead>
<tbody>